Reputation: 1166
Can i make my Action Bar app icon clickable without displaying the back icon?
This is my code, it works, I have only layout problem:
actionBar.setDisplayHomeAsUpEnabled(true);
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
//Do stuff
return true;
default:
return super.onOptionsItemSelected(item);
}
}
This is my activity layout, what I want is remove back icon, is it possible?
Upvotes: 0
Views: 116
Reputation: 2075
Try to use setHomeButtonEnabled(boolean enabled)
instead of setDisplayHomeAsUpEnabled(boolean enabled)
. The latter do exactly the same thing as former which is enabling home button but additionally put up affordance sign which you want to get rid off.
Upvotes: 2