Issue
I have some problems with the default Android lifecyle.
My app has an Activity
(let's call it A
) and a MapActivity
(let's call it M
)
Activity A
has an AsyncTask
to retrieve an image from an URL (EDIT3: which seems to not affect my issue, but I mention it in order to give full info)
and the MapActivity M
is currently an empty map, no config or modifications made.
My use case is the folowing:
I go through my app normally, and end up starting A
with no errors.
When I start M
from A
everything works as expected, but when I go back, Activity A
is already finished.
I Log.d
every step in the lifecycle in both activities and found the following:
Start Activity A
onCreate - A
onStart - A
onResume - A
Start Activity M
onPause - A
onCreate - M
onStart - M
onResume - M
onStop - A
Back on Activity M
onPause - M
onDestroy - A
onStop - M
onDestroy - M
So I end up finishing Activity A
and M
when I press the back button on M
I tried different kind of Activities (MapActivities, Activities, from the same package, from different packages) with the same exact result.
EDIT:
- I don't use
finish();
method anywhere - My activity is started with the folowing code:
Intent I = new Intent(context, ActivityName.class);
context.startActivity(I);
EDIT2:
- Checked isFinishing method on the Activity
A
onPause
step, and the result isfalse
so it was not suposed to be finishing
Any idea? is there something I am missing? Thx in advance for your time and ideas!
Solution
Thanks to @Stigi who pointed me in the right path to keep debugging. (Can I give you points somehow?)
In my case android:noHistory="true"
was set on the Manifest.xml
so when I came back from Activity M
to A
it was not on the pile, and it looked like it was closed.
Answered By - Eloi Navarro
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.