This will not be executed always. Android lets apps running in the background, although user "closed" it. When you launch the app it will not necessarily be created.
On Wednesday, August 22, 2012 3:00:40 PM UTC+2, casantos wrote: > > On Wed, Aug 22, 2012 at 9:23 AM, user123 <[email protected] <javascript:>> > wrote: > > I want to detect exactly when the user says, hey, let's open the app, > and > > taps on the app's icon, not anything else. Is this hard to understand? > > @Override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > Intent intent = getIntent(); > boolean fromLauncher = savedInstanceState == null && > Intent.ACTION_MAIN.equals(intent.getAction()) > && > > intent.getCategories().contains(Intent.CATEGORY_LAUNCHER); > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

