sethomebutton listener android code example
Example: sethomebutton listener android
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == android.R.id.home) {
onBackPressed(); return true;
}
return super.onOptionsItemSelected(item);
}