1

I saw another question here that is the same as mine, but no one answered it. I thought maybe I could try my luck.

I have an android application. The behavior I want is that, whenever the user visits a fragment/activity, and he closes my app/opens another app, when he returns to my app, he shall be presented with the screen that he last accessed.

This holds true whenever I run the app via Eclipse.

I noticed however, that when I export my APK, this doesnt happen. What happens is that no matter what fragment/activity the user last accessed, he always returns to the page after the splashcreen.

  1. What could I be doing wrong?
  2. What could be the reason behind this, direct build is not the same as the APK.

this is the code that happens when I resume

protected void onResume() {
    super.onResume();
    showPin();
    ((TextView) getSupportActionBar().getCustomView()).setText("MyTitle");
}

@Override
protected void onPostResume() {
    super.onPostResume();

    if (currentFragment == null)
        currentFragment = builder;

    getSupportFragmentManager()
        .beginTransaction()
        .hide(builder)
        .hide(gem)
        .hide(tyke)
        .hide(spike)
        .hide(addon)
        .hide(recent)
        .hide(timber)
        .commit();


    getSupportFragmentManager()
        .beginTransaction()
        .show(currentFragment)
        .commit();

}
user229044
  • 232,980
  • 40
  • 330
  • 338
momoja
  • 938
  • 9
  • 23
  • solved it using the answer from http://stackoverflow.com/questions/4341600/how-to-prevent-multiple-instances-of-an-activity-when-it-is-launched-with-differ – momoja Mar 14 '14 at 03:45
  • I think you should add that as an answer and mark it as the one that solved your problem. That way your question won't appear as unanswered – josebama Apr 09 '14 at 11:53

0 Answers0