android - Imagem Button back to last activity -


my project have 5 activities (1 menu, 3 sub menus , 1 help)

all activities have button (except activity). inside activity have imagem button back.

what should when button clicked previous activive?

i'm using method return previous activity:

override      public boolean onkeydown (int keycode, keyevent event) {          if (keycode == keyevent.keycode_back) {              finish ();           }          return true;      } 

but beyond want implement button.

just this:

button buttonx = (button)findviewbyid(r.id.buttonxname); // id of button. // register onclick listener implementation above buttonx.setonclicklistener(new onclicklistener() {     public void onclick(view v)     {         finish()     }  }); 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -