i am Trying more Flags to prevent the Activity to be opened more than one time at the Same time

Mahmoud A.Belal

i tried Flags like

 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |Intent.FLAG_ACTIVITY_CLEAR_TASK);

i Login to my application and open the home page > when i receive a notification and preessed on it to see details at home page it opened well But the previous

v4_adi

You can achieve this with the help of launch mode

go to manifest where your activity is declared. And add following attribute to your activity declaration.

android:launchMode="singleTask"

And in your activity class ovveride following method

public void onNewIntent(Intent intent) {
   setIntent(intent);
   //do other stuff with new intent
}

I will also suggest you to read more about activity launch mode https://developer.android.com/guide/topics/manifest/activity-element.html

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Running where() more more than one time

Is it possible for a JVM to run more than one program at the same time?

How can I have more than one imageview on the screen at the same time when I click the screen? (Circle one imageview)

Make the select statement wait for more than one channel at the same time

Save file for more than one user at the same time

regx or pattern - How to prevent entering same character more than one time?

Allow more than one accordion to open at the same time

How can I create more than one array at the same time using a generator?

How to replace more than one word in JavaScript string at a same time?

Allow more than one python threads to use resource at the same time

Using RAND() keyword in more than one query at the same time

Why can't I catch the exception more than one time?

How to print more than one div at the same time in same pdf?

How to scan more than one location at the same time with ClamAV

Why I can't reference to WITH expression more than one time?

Run more than one application in the same time

Destructor called one more time than I expected

Insert records into a table from more than one users at same time

Counter not increasing more than one time

Can I use OpenGL in more than one language at the same time?

Run more than one lein task at the same time

Prevent developer from placing a UserControl more than one time in Design Time

Can I accidentally push more than one Git feature branch at the same time?

Keras fit_generator is training one sample at a time, while i am yeilding more than one sample from generator

Can I run more than one ansible instance at the same time on the same machine?

Is there a way that I can set more than one property in a list to "" or null at the same time with a .ForEach?

How do I connect kqlmagic to more than one Log Analytics workspace at the same time?

C program fails to execute more than one statement at the same time

Groovy Mock the same Stream call more than one time