由网友(何必挽离人)分享简介:我要检测在Android应用程序中的动作条应用程序的图标长preSS。这可能吗?I want to detect long press on application's icon in the ActionBar in Android application. Is it possible?推荐答案添加自定义视图...
我要检测在Android应用程序中的动作条应用程序的图标长preSS。这可能吗?
I want to detect long press on application's icon in the ActionBar in Android application. Is it possible?
推荐答案
添加自定义视图操作栏
View view = getLayoutInflater().inflate(R.layout.actionbar,null);
btnClose = (ImageView) view.findViewById(R.id.btnClose);
btnClose.setOnLongClickListener(new OnLongClickListener()
{
@Override
public boolean onLongClick(View v) {
Log.d("rvg", "Long click:");
return false;
}
});
getSupportActionBar() . setCustomView(view);
相关推荐
最新文章