Hi, Finally I made it work, so I post the solution as someone could be interested in the future: The point is to set the activity launchmode to singleTask (singleInstance should work too) instead of singleTop
android:launchMode="singleTask"> Bye. On 11 abr, 14:54, Gorka <[email protected]> wrote: > Hi, > > I don´t know if someone is reading me, but I don´t give up :). Maybe > that could be useful for someone in the future. > My Manifest file looks like that rigth now: > > <intent-filter> > <action android:name="android.intent.action.MAIN" /> > <category android:name="android.intent.category.LAUNCHER" /> > </intent-filter> > <intent-filter> > <action android:name="android.nfc.action.NDEF_DISCOVERED"/> > <data android:mimeType="*/*" /> > > <category android:name="android.intent.category.DEFAULT"/> > </intent-filter> > > What is happening rigth now is that, if I start by myself the > application, it runs ok and I get the onNewIntent messages I am > supposed to used. So the application reads all the tags. However, if > the application is started when it detects a tag, it doesn´t receive > onNewIntent messages anymore. > > Does anyone know how to solve this? > I continue reading ... > > Bye. > > On 11 abr, 10:36, Gorka <[email protected]> wrote: > > > > > > > > > Hi, > > > Here I am once again. > > > I have seen that if I minimize the app, when I detect a new tag the > > application is restarted and the OnRestart and OnResume methods are > > called. But the OnNewIntent isnotreceived. > > > But the way, if the application is restarted, how can I get the > > activity that was called¿? > > > On 11 abr, 10:22, Gorka <[email protected]> wrote: > > > > Hi, > > > > Here is the message I get when the phone detects the tag. > > > As I said, the first time the app is started, but the second time > > > nothing happens. > > > > I/ActivityManager (107): Startingintent: > > > {act=android.nfc.action.NDEF_DISCOVERED typ=text/plain flg=0x01000000 > > > cmp=com.android.nfcvoicereader/.nfcvoicereader (has extras) } from pid > > > 189 > > > > Thanks. > > > > On 11 abr, 09:48, Gorka <[email protected]> wrote: > > > > > Hi, > > > > > Yes, I have the onNewIntent method declared as you said. > > > > > @Override > > > > public void onNewIntent(Intentintent) { > > > > Log.d(TAG, "------------> On NewIntent"); > > > > > } > > > > > The problem is that i don´t get the message. > > > > > On 9 abr, 09:34, nadam <[email protected]> wrote: > > > > > > Make sure onNewIntent is overridden correctly. Should look like this: > > > > > > @Override > > > > > public void onNewIntent(Intentintent) { > > > > > ... > > > > > > } > > > > > > On 8 Apr, 16:11, Gorka <[email protected]> wrote: > > > > > > > Hi, > > > > > > > I am trying to read NFC tags with my Nexus S mobile. > > > > > > > In my Manifest file I have theintentfiltered: > > > > > > > <intent-filter> > > > > > > <action > > > > > > android:name="android.nfc.action.NDEF_DISCOVERED"/ > > > > > > > <data android:mimeType="*/*" /> > > > > > > > <category > > > > > > android:name="android.intent.category.DEFAULT"/> > > > > > > </intent-filter> > > > > > > > When the mobile detects a tag and theintentis created by the system, > > > > > > my application is started. So, the filter works fine. > > > > > > > The problem is that, once the application is opened viaIntent, if > > > > > > the > > > > > > mobile detects another NDEF_DISCOVERED the application doesnot > > > > > > receive it. > > > > > > > I have implemented the onNewIntent method, but it isnotcalled. I > > > > > > also have added the android:launchMode="singleTop" line to my > > > > > > activity. > > > > > > > Does anyone know can I solve my problem? > > > > > > > Thanks and bye. -- 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

