I have two activities with exactly same intent filters and I would like to start one of them depending on the condition.
ActivityA should be started by the user when he/she gets the Intent delivered by Android OS to the “Complete action using” list and now the user navigates to ActivityB, so now presently the user is in ActivityB.
So when the user does the same action, I don’t want the Android OS to pop again the same “Complete action List” with ActivityA but I want the activity A be replaced now by Activity B.(That is the action changes then the ActivityB is in foreground).
Is this possible?
Use an Intent action in conjunction with Intent extras to figure out where the Intent needs to resolve.
So, for example, you can set some sort of flag and if a specific flag is set (your extra) make it go to ActivityB if it is not… or the other way; no extra show ActivityA if there is an extra go to ActivityB.
That is a real simple example, there are many other ways of dealing with what you are trying to accomplish.
Look into Intents and Intent Filters http://developer.android.com/guide/topics/intents/intents-filters.html and Activity http://developer.android.com/reference/android/app/Activity.html
Also this is a good read as well, http://developer.android.com/guide/topics/fundamentals.html