Multiple parent Activities for one child activity toolbar Back Button
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
int id = item.getItemId();
if (id == android.R.id.home) {
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
I have to Override this function for the functionality of the back button, call back to the same parent activity from which the child is called but I don't understand this code of line:
id == android.R.id.home
What is the R.id.home? home represent for? is I have to use the same R.id.home Everywhere, where ever I have to use this back button functionality in my app?
