As it is possible to redefine the value of the back button, so that by pressing it would be called not spinning activity from the stack, but to work as UpHome.

  • those. go to the main page of the application? - Iman
  • No, on that activit, which is specified in the manifest in android: parentActivityName. Although if there is an option how to return to the main page, in parallel, having nailed all the other activities on the stack, it will also work - tosh17

1 answer 1

@Override public void onBackPressed() { Intent intent = new Intent(Π°ΠΊΡ‚ΠΈΠ²ΠΈΡ‚ΠΈ_ΠΎΡ‚ΠΊΡƒΠ΄Π°.this, Π°ΠΊΡ‚ΠΈΠ²ΠΈΡ‚ΠΈ_ΠΊΡƒΠ΄Π°.class); startActivity(intent); finish(); // Π·Π°ΠΊΡ€Ρ‹Π²Π°Π΅ΠΌ эту Π°ΠΊΡ‚ΠΈΠ²ΠΈΡ‚ΠΈ }