D
D
Denis Afonin2015-09-20 22:35:39
Android
Denis Afonin, 2015-09-20 22:35:39

Why is the main activity closed after starting the application in GenyMotion after calling the startActivityForResult(intent, 0); method?

There is a main activity of type Fragment. From it, at the click of a button, another (child) activity is called to enter data. The child activity is made small so that the main activity can be seen in the background. So, when I click on the button, the child activity starts, but for some reason the main activity closes. Well, since the main activity is no longer active, the thread running in it falls out on a NullPointerException error and I get an application crash.
On a real device, everything works as it should. Why can this happen on a virtual device?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2015-09-20
@GavriKos

In DeveloperMode there is a checkbox - "kill inactive activities" or something like that. Check if it is installed.
In general, as far as I remember, Google recommends that you always consider that a non-current activity can be killed. To check this, they created a special checkmark in the settings ...

D
Denis Afonin, 2015-09-20
@Afdenis

Droid version 4.3. There is no such item.
372ccec499d24006b1b1e21408ad5b03.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question