Issue
I launched my application after clicking the link on the whats-app with concept of deep-linking. after that i press the home, and every time when i launched the application whats-app and it opens my application. it looks like application remains attached. any help to solve this problem?
Solution
here you can find the official guidelines how to launch "UP" in your own app stack: http://developer.android.com/training/implementing-navigation/ancestral.html
you have to define your "home" activity in the manifest like this:
<activity
android:name=".DeepLinkActivity"
android:parentActivityName="com.my.app.HomeActivity">
then on pressing UP you process this code:
Intent upIntent = NavUtils.getParentActivityIntent(this);
if (NavUtils.shouldUpRecreateTask(this, upIntent)) {
// This activity is NOT part of this app's task, so create a new task
// when navigating up, with a synthesized back stack.
TaskStackBuilder.create(this)
// Add all of this activity's parents to the back stack
.addNextIntentWithParentStack(upIntent)
// Navigate up to the closest parent
.startActivities();
} else {
// This activity is part of this app's task, so simply
// navigate up to the logical parent activity.
NavUtils.navigateUpTo(this, upIntent);
}
Answered By - Budius
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.