Reputation: 119
I'm having some trouble getting this to work, and I'm pretty close to concluding it might be a bug in Android, but I need some opinions about it. This is what happens:
Now, my two questions are:
1) Why does this happen? How is it different to go back to an app from the recent apps list or to launch it again from the drawer?
2) How can I prevent this effect? I've tried finishing the PreferenceActivity in OnPause(), setting FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET to true, and some other things, to no avail. The only "solution" I've found is to set excludeFromRecents to true in the PreferenceActivity, but I don't like this, because then the app just doesn't appear in the recent apps list at all.
Any ideas/explanations?
Upvotes: 1
Views: 384
Reputation: 119
Well, I managed to solve this on my own, but I'm posting here just in case this happens to somebody else.
My problem was that I was declaring the PreferenceActivity as SingleInstance. This seems to mess up the navigation on coming back from recent apps, maybe the system restarts the task and nothing else.
My problem is solved, but I'm still unsure about whether to consider this a bug or not. It seems to have sense for the system to work this way, but on the other hand this can be pretty inconvenient. I'd appreciate any coments on the subject.
Upvotes: 2