Hopefully you have figured out what the problem is. I can't say I fully understand it.
But one thing is sure with "onNewIntent()". I have looked at it when I was configuring an activity on behalf of "search" functionality. This method is invoked ONLY IF this activity is on top of the visible stack. That means if you are navigating somewhere else to invoke your icons, and if this activity is not on top because of that, then the "onNewIntent()" is not invoked. Typically if this activity is to invoke itself for whatever reason, or a service is to invoke it while it is on top then you will see the "onNewIntent()". Hope this is useful Satya (http://www.satyakomatineni.com) On Sat, Nov 14, 2009 at 6:58 AM, João Sauer <[email protected]> wrote: > Hi, > > What I'm trying to do was supposed to be very simple, but is not > working. :) > I would like to have 2 Icons that will call my activity, that is the > only one in the package. > But, when the activity is called, I would like to know which of these > Icons was used. > In the logs, I'm able to see that the Intent sent asap after press the > icon is sending this message like: > I( 569:0x23d) Starting activity: Intent > { action=android.intent.action.MAIN categories= > {android.intent.category.LAUNCHER} flags=0x10200000 comp={teste.teste/ > teste.teste.alias1} } > > But, my override of onNewIntent is never called and the onResume is > receiving a modified version of the Intent: > D( 896:0x380) Intent is Intent { action=android.intent.action.MAIN > categories={android.intent.category.LAUNCHER} flags=0x10200000 comp= > {teste.teste/teste.teste.mainapp} } > > As you can see, the alias1 packagename was modified to mainapp. And > because of this, I'm unable to check which button was applied. > > My code in the manifest file is simple: > <application android:icon="@drawable/icon" android:label="@string/ > app_name" android:debuggable="true" > > <activity android:name=".mainapp" android:label="@string/ > app_name" android:configChanges="orientation" > android:launchMode="singleTop"> > <intent-filter> > <action > android:name="android.intent.action.MAIN" /> > </intent-filter> > </activity> > <activity-alias android:name="alias1" android:label="alias1" > android:icon="@drawable/icon" android:targetActivity=".mainapp" > android:launchMode="singleTop" > > <intent-filter> > <action > android:name="android.intent.action.MAIN" /> > <category > android:name="android.intent.category.LAUNCHER" /> > </intent-filter> > </activity-alias> > <activity-alias android:name="alias2" android:label="alias2" > android:icon="@drawable/icon" android:targetActivity=".mainapp" > android:launchMode="singleTop"> > <intent-filter> > <action > android:name="android.intent.action.MAIN" /> > <category > android:name="android.intent.category.LAUNCHER" /> > </intent-filter> > </activity-alias> > <receiver android:name=".BootMainapp"> > <intent-filter> > <action > android:name="android.intent.action.BOOT_COMPLETED" /> > <category > android:name="android.intent.category.HOME" /> > </intent-filter> > </receiver> > </application> > > As you can see, I'm using the singleTop definition, as a requirement > for onNewIntent call. > > Any ideas what could be wrong here? Or, How can I have a way to check > which Icon was used to call my Acitivity? > > Thank you, > Joao Sauer > > -- > 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 -- 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

