Closed JohnMcLear closed 10 years ago
This sounds familiar. We fixed similar issues in the past by adding android:noHistory="true"
to the activity. Info is from this comment but TBH, I can't recall the exact details.
I'm not convinced noHistory is right for me as noHistory covers more the history of navigating through an app. My issue is that the listeners try to re-attached when they are already attached as far as I can tell..
http://stackoverflow.com/questions/11836080/how-does-androidnohistory-true-work for reading on noHistory.
Can you check to see if the listen exists before re-adding? If you have sample code to break I can look at later this week.
Is there a method for seeing if it's listening? I did look for one but failed..
Trying android:launchMode="singleTask"
to the activity in the manifest
Hrm, By jove this seems to have cracked it :)
Actually maybe not, what this fix does it just redirect you back to the original app, blah. I wonder if there is a way to fire an event when an intent arrives instead of checking for it on startup?
Only one app is good thing.
Do you have a mime-type handler to catch the intent fired by scanning the tag? Due to some legacy stuff, a ndef-mine event is fired. See http://stackoverflow.com/questions/23059763/chariotsolutions-phonegap-nfc-plugin-intent
Trying something else, trying to exit my app on pause..
You will wanna add android:launchMode="singleTask" to your activity to stop this from happening then ensure whatever intent plugin you use supports handling new intents while an app is open (but in the background..)..
It might make sense to make the plugin add android:launchMode="singleTask" anyway because you don't want two instances of listeners, I don't think?
This was due to the app already being open.. If I force close the app then open it with an intent it works..
Basically you use
cordova run android
then press the home button then launch a browser, hit share, select the app and it will fail because the app is already "running"..