tags:

views:

44

answers:

2

Hi, I would like to know if there is a way of preventing a duplicate launch of browser/activity, while the user is already focused on it.

mybe there is a way to detect before if the user's current screen is already focused on the same activity/browser i intent to launch?

thanks,

ray.

A: 

check out the following intent flag http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_SINGLE_TOP

what about: FLAG_ACTIVITY_REORDER_TO_FRONT?

ekawas
Well i tried this:browserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);browserIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);it didnt work.. the browser still jumped to the intent page.
rayman
A: 

what about: FLAG_ACTIVITY_REORDER_TO_FRONT?

ekawas
Also didnt work..
rayman
The first answer was how I do it in my app to prevent duplicate activities. I guess I do not understand your question.
ekawas