Answer the question
In order to leave comments, you need to log in
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
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 ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question