Near Stream there is a small arrow that takes u to the previous activity when clicked
I want to make the same in my app, I used
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
do I need to use onOptionsItemSelected
?
The arrow is appearing, but nothing happens once clicked.
And I have two Items in my menu, they appear everywhere where I call OnCreateOptionsMenu
this is my item code where I want to to appear only in my last activity, How ?
<item
android:id="@+id/bAbout"
android:title="About"
android:showAsAction="always"/>
Yes you have to implement
onOptionsItemSelected()
. The id for that button isandroid.R.id.home
I'm not sure what the problem here is. Of course you should only implement
onCreateOptionsMenu()
and inflate that menu resource where you want it. RemovingonCreateOptionsMenu()
for all activities which are not supposed to have these options should work.