Friday, 15 March 2013

android - How to launch a method on application opening -



android - How to launch a method on application opening -

is there event on application opening, illustration when open previous opened , closed home key application lastly applications menu.

when talking application in general, can implement application class, override oncreate() callback method, called every time application starts. when talking activity class instances, utilize activity class callback methods check if current activity comes foreground (becomes visible user). example, may need implement onresume() and/or onstart() lifecycle callback methods.........

android application class not have onresume() method. user sees , interacts activities (even if utilize dialogs or fragments). application in general may not contain activities, services, content providers , broadcast receivers well. if you'd like, can implement onresume() method in particular application class , phone call activity's onresume() (or onstart()). of course, it's not convinient create such phone call every activity in application. hence makes sense implement baseactivity (which extends activity) , subclass every application activity.

android

No comments:

Post a Comment