There is a MainActivity and when it is started, an AlertDialog is called which asks which activity to launch the first or second. When you select another activity starts and you need to make sure that it is the main one. That is, when I launch the next activation and press the back button, it throws me out to MainActivity. I tried to set different setContentView (), but the problem is that after selecting the xml file was not superimposed.

  • What is the problem? The question is kind of tangled - elik
  • Try to make root through meta? - elik

1 answer 1

Please answer corrected

public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; default: return super.onOptionsItemSelected(item); } } 
  • On the contrary, I need the next activation (not the parent) to close the entire application when you click "Back" - MaksimHawkins
  • AAAA well, so it’s even easier to finish the method right now, right now, secu corrected the answer - elik