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.
- What could I be doing wrong?
- 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();
}