android - onResume() is not called in physical device instead onCreate() is called -


iam little bit amazed this.i have onresume() in activity.its called , works in emulator, in physical device samsung galaxy note specific jellybean installed,its not called.instead oncreate() called time.why happens?

public void onresume(){     super.onresume();     if(firsttime){         try {             toast.maketext(getapplicationcontext(), "resuming activity",toast.length_long).show();             addreminder();         } catch(exception exception) {             exception.printstacktrace();         }     } else {         firsttime=true;     } } 

this code.firsttime static boolean variable.it used prevent onresume() being called when app started first time

considering current scenario, should save variable in preferences instead of relying on activities lifecycle since lifecycle depends on many things. using static variable scenario bad choice in general.i think should solve problem.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -