我要检测在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);