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
1
vote
0 answers

App good with one new intent but when I tap on same link again. Get error: No Activity found to handle Intent { act=android.intent.action.VIEW

I use Intent to send message from website to Progressive Web App. Just to show admob ads in native code. Best solution what I found is add code to override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) …
1
vote
0 answers

android - NFC in fragments, onNewIntent isn't called after I return from another activity

I have an application that uses the NFC. I have a MainActivity that extends a BaseActivity. In the BaseActivity, on the "onCreate" method, I initialize the nfc. ---- Base Activity ---- .... private void initializeNfc() { NfcManager manager =…
Alberto Deidda
  • 506
  • 1
  • 4
  • 13
1
vote
2 answers

What is difference between OnActivityResult() and OnNewResult()?

Please look at this photo I want to make an application looks like that photo.. When I click the button to MainActivity on sub-activities, OnActivityResult() and OnNewIntent() are all called in MainActicity. I intend to call OnActivityResult() for…
Jung Jaehoon
  • 101
  • 1
  • 12
1
vote
5 answers

onNewIntent never get triggered in fragment

I am having a problem(s) with getting onNewIntent method to work inside Fragment. I have tried everything but nothing seems to work. My project worked perfectly when using activities but when I switched to fragments it stopped working. My idea is…
DaGuy
  • 65
  • 1
  • 6
1
vote
0 answers

How to perform the intended action from notification panel without making onNewIntent opening the activity

I am a beginner in android coding. I am working on a mediaplayer project as a learning exercise. I have managed to get the mediaplayer playing in the background and to show a notification with play/pause button when the activity is pushed to…
1
vote
1 answer

Why is onNewIntent() not used together with singleInstance launchmode?

Why is onNewIntent() not used together with singleInstance launchmode? I mean if I re-launch my singleInstance Activity I might still want to get that new Intent, right?
JohnyTex
  • 3,323
  • 5
  • 29
  • 52
1
vote
2 answers

How to determine if a search was performed through text input or voice recognition?

This will be a self-answered question, because I'd like to clearly document how to determine if a search intent was triggered by text input or voice recognition. My reason for needing this was because I was trying to log searches in my app to Google…
NoChinDeluxe
  • 3,446
  • 1
  • 16
  • 29
1
vote
1 answer

onNewIntent() not called after onResume()

Flow: Open app (MainActivity) Press home button ( calling onPause() in activity ) Starting same activity, with different intent Intent intent = Utils.createIntent(....., this, MainActivity.class); // this will add some extra to our intent …
Boldijar Paul
  • 5,405
  • 9
  • 46
  • 94
1
vote
1 answer

How do I retrieve the new value of an intent after restarting an activity, and not the original one?

There's a lot of questions about this already, and I feel like my code should work. What I'm trying to do is Activity A starts Activity B, sending an intent. Activity B then starts Activity A for result, and a new Intent should be received. My…
A Osman
  • 171
  • 2
  • 8
1
vote
1 answer

Android: why am i always getting the first intent from push notifications?

I'm making a push notification service for my news app, i'm sending a notification from my php server using the new GoogleCloudMessaging (GCM), when the message arrives to the phone, my app catches the message and make a notification out of it, when…
Fadi Obaji
  • 1,454
  • 4
  • 27
  • 57
1
vote
0 answers

Device Specific: onNewIntent() is not being called in Samsung Galaxy S4 - Android KitKat 4.4.2

Before asking this question, I did a lot of search. But none of the answers here did work for me: onNewIntent is not called, onNewIntent not called on restart, onNewIntent() not getting called in some devices, my onNewIntent is not calling I am…
Green goblin
  • 9,898
  • 13
  • 71
  • 100
1
vote
1 answer

How to detect if my Android Activity was already running when onNewIntent() is called?

I have an Android Activity that sometimes is started by the user and sometimes is started from a service. When started from the service (by sending an Intent that is received by my Activities onNewIntent() callback) I just want it to update its…
Boo
  • 165
  • 2
  • 11
1
vote
0 answers

Continously updating marker on running Google Map v2

I am making a tracking app that receive data(longitude and latitude) from the user via SMS and display on the googlemapv2. I want my application to work continously and the marker update on new location when a new message is received.But the marker…
1
vote
1 answer

OnNewIntent in API 19 Android

I would like to recover the android intent my activity is launched with. My activity, tested in API 19 (KitKat), besides the main intent, has the following intent filter and parameters: android:alwaysRetainTaskState="false" …
Mikaël Mayer
  • 10,425
  • 6
  • 64
  • 101
0
votes
1 answer

Can't get extras from notification intent

Can't get extras from notification intent. Read all articles here but also does not work. Need Help. Here is my code this is my FirebaseMessagingService. Here i add different flags, but result was the same class MyFirebaseMessagingService :…