Picture
! Action bar
Iβm talking about (number 1, in the figure), a button with a small arrow and an application icon and the upper left side of the screen. It is automatically detected when you select the Black Activity template.
My application has a rather huge hierarchy chart, now it has about 25 activities. I just show a few guides, and you can go to them according to categories.
Now that the back button (?) On the action bar is on every screen, and I want to save it. The code does not show an error, but when I click this button, the application stops working. What I want is to simply repeat the actual function of the "Back" button using the button (Number 1) that I showed in the image. When I click it, the top screen should close and the last should open. Just close the screen.
What I tried:
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: NavUtils.navigateUpFromSameTask(this); return true; } return super.onOptionsItemSelected(item); }
it is a function that inflates this button with an error along with the action bar. I tried replacing all the code and calling the Finish function, but that was unsuccessful. I could not find a function specially created for this upper left button ...
I want the top screen in the stack (the one in the foreground) to close when this button has been touched. How to do it?
java android eclipse button action
user2580712
source share