M
M
Mikhail_dev2014-11-28 13:11:11
Android
Mikhail_dev, 2014-11-28 13:11:11

Why is onDestroy always called when another activity starts?

Hello.
Came for testing device Nexus5 with Android 4.4.2. Delivered application for testing. When starting a new activity

startActivity(new Intent(this, SettingsActivity.class));

The past one constantly calls onDestroy. this is how all activities behave. In the manifest in activities
<activity
            android:name=".ui.SettingsActivity"
            android:label="@string/settings">
        </activity>

If you just turn off the screen, then only onStop works properly. This application works properly on other devices - Nexus7, Huawei 8950, Nexus4. Then I decided to update the firmware - updated to 4.4.3. Same thing, no change. Then I updated to 4.4.4. No changes, onDestroy still fires. The phone is clean, it only has this application.
Tell me where to dig.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
itdroid, 2014-11-28
@Mikhail_dev

Hello,
Check Settings->Developer options->'Don't keep activities' item.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question