0

I've checked that if I press home button on that API, the current activity finishes, when I don't want that to happen.

I've already checked in API 22 and API 23 that if home button is pressed, on these APIs, activity is not finished and can be restarted from the point it was.

I thought that maybe on API versions prior to 22 the button had by default that behavior, so it couldn't be helped, but I've checked that in API 19 I get the desired behavior. It looks strange that they just chose one API to offer that behavior but... maybe it is what it's happening.

The code for onStop() that's launched is pretty straightforward:

 @Override
    protected void onStop()
    {
        try {
            toast.cancel();

        }
        catch (Exception d)
        {

        }
        super.onStop();
    }

Is this a default behavior for API 21 for the home button press, and it cannot be helped, or is there any way to cause the button press not to cause to finish the activity?

user2638180
  • 1,013
  • 16
  • 37
  • 2
    Perhaps you enabled "don't keep activities" in the developer settings on the emulator. – CommonsWare Jan 15 '19 at 22:16
  • 1
    Either way that's a legal behavior by the framework you have to be able to account for. – Gabe Sechan Jan 15 '19 at 22:26
  • @CommonsWare, thanks for your comment, but that setting was disabled, I even tried to delete and set the emulator againg, but to no avail, so, it looks more like something API related that a problem caused by the emulator. – user2638180 Jan 15 '19 at 22:56

0 Answers0