Scorpion
Scorpion

Reputation: 6901

Android Starting 2 activity at a time causes issue

I have number of activities in my app. From front end I can start different different activities but I have back end as well, that means from server if i received a message than app has to take action on the message and start the activity based on the message.

My problem is that sometimes app received message from the server and app starts activity and at the same time user also performs click on UI and navigates to other activity. In this case one of my activity is not started as android can't start both activity at a time.

Is there any INTENT LAG which can help to resolve this issue?

Right now what i am doing is if i received message from server than I am using one global flag and using that flag i am avoiding such situation, but I am looking for better solution if anyone has any idea on this.

Upvotes: 0

Views: 95

Answers (1)

David Wasser
David Wasser

Reputation: 95626

Your solution sounds fine. There really isn't a good way to do this because Android discourages this behaviour. If your application requires this behaviour you will need to create a workaround, which it sounds like you have done.

Upvotes: 1

Related Questions