Reputation: 4300
i want to create a button which works like a real back button.When i press the back button(my button) this is work same with real button.How can i do programmatically?
Upvotes: 1
Views: 1824
Reputation: 755
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if ((keyCode == KeyEvent.KEYCODE_BACK))
{
finish();
}
return super.onKeyDown(keyCode, event);
}
Upvotes: 0