Questions tagged [onnewintent]

protected method in android.app.Activity class

onNewIntent(Intent) is a protected method in android.app.Activity class and this is called for activities that set launchMode to "singleTop" in their package, or if a client used the FLAG_ACTIVITY_SINGLE_TOP flag when calling startActivity(Intent).

55 questions
18
votes
3 answers

Android OnNewIntent not called

I saw several approaches and I tried everything but couldnt make it work.I dont know why it is so complicated, in the docs it looks so easy! I want to trigger the OnNewIntent with a notification (the user clicks on it in the notification…
Aksiom
  • 1,565
  • 4
  • 25
  • 39
9
votes
3 answers

Activity onNewIntent Null Pointer Exception

I initialize my lists in my activity onCreate() like below: private List filtered; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
savepopulation
  • 11,736
  • 4
  • 55
  • 80
9
votes
0 answers

Is there a way to grab an NFC tag without having onPause/onResume fire?

looking at this question: onNewIntent() lifecycle and registered listeners I see that the OP is experiencing the same problem I am, but I'm not clear on why the solution provided serves his purposes. When a user taps their NFC to the device, I am…
Yevgeny Simkin
  • 27,946
  • 39
  • 137
  • 236
4
votes
1 answer

Android onNewIntent() not triggered when activity is invisible

I have 2 activities, first one being MainActivity. In Manifest launch mode of Second Activity is set as SingleInstance.The button in MainActivity starts SecondActivity, which has a button which triggers notification. The only problem is…
jobin
  • 1,489
  • 5
  • 27
  • 52
4
votes
0 answers

How to open a file with custom extension generated by an app in other decive with same app?

I have an app which saves database files with extension ".swt" in a particular folder. I was able to share this file using intent from one device to other but the device which received the file could not open it through the same app. Here is my…
lavmhrzn
  • 41
  • 2
3
votes
0 answers

USB redetection on running app

I am new to android. I am trying to detect usb attached to android device. When the usb is attached for first time, the specifiec app opens up.(Working fine). Now what I am tryng to do is if the app already opened,and a usb device is attached,it…
Amrit
  • 49
  • 3
3
votes
0 answers

onNewIntent() not getting called in some devices

I am implementing Oauth (twitter, google) for an Android application and some users have complained because they cannot log in; after analysing the problem I saw that in some devices sometimes the onNewIntent() is not called and onCreate() method is…
Kuikiker
  • 156
  • 13
2
votes
1 answer

Can't get onNewIntent() to trigger

so i've gone through over 7 stackoverflow questions with solutions to solving this onNewIntent() but even after all that I cant seem to get it to work. The activity that I want to trigger onNewIntent():
Malcolm Maima
  • 63
  • 2
  • 2
  • 10
2
votes
0 answers

How to Ignore NFC Intent(make phone not vibrating)?

I have in my Code an Activity which has 2 Fragments (Logo) and (config). when the activity starts, it launches Logo Fragment. and when I got a new Intent(NFC Tag) it switches to config Fragment. The problem when I am in config Fragment and new NFC…
Karam
  • 303
  • 2
  • 16
2
votes
1 answer

Adding item to recyclerview inside fragment on Notification Click

SCENARIO I am having 2 fragments inside a View Pager. In one of the fragment I am having a button to generate notification. Notification is generated successfully. Now I want to send some data on notification click back to fragment. For this I am…
Vivek Mishra
  • 5,669
  • 9
  • 46
  • 84
2
votes
0 answers

OnNewIntent is not called NFC Tag

I am creating a simple Android mobile application that reads data from an NFC Tag. i want my application to be opened once it has detected that an NFC tag was tapped. I can't figure out what I might've missed on my code. When I try to tap an NFC…
bless1204
  • 643
  • 1
  • 8
  • 17
2
votes
0 answers

pendingIntent Don't call OnNewIntent()

I receive message in my gcmlistener service and when app is in background , I receive notification but when i tap on it my intent doesn't call OnNewIntent in my main activity . Here is details what I've done public class MyGcmPushReceiver extends…
2
votes
1 answer

NFC tag(for NfcA) scan works only from the second time

I wrote a custom plugin to read blocks of data from an NfcA(i.e.non-ndef) tag. It seems to work fine , but only after the second scan. I am using Activity intent to derive the "NfcAdapter.EXTRA_TAG" to later use it for reading the values. I am also…
Ajit
  • 964
  • 10
  • 17
2
votes
1 answer

onNewIntent not called on restart

I have an alarm clock app, that is using Alarm Manager and a Broadcast Receiver. The app is one single activity and 4 fragments. When an alarm goes off the onReceive method sends an intent to the main activity, the main activity receives this…
1
vote
2 answers

Xamarin.Android: Receive View and Send actions in an already running instance of an App (LaunchMode is SingleTop)

I want my app to be a viewer and send target for PDFs but don't want it to create new instances everytime. How do I catch the view intent action in my MainActivity? I tried OnNewIntent() but it doesn't get called. Only if the app wasn't already…
1
2 3 4