Hi All,
Hope doing well.
I have one app with one button.
On click of button, I am trying to launch second app by passing
some bundle.
My second app is having two activities. I launched the second app
from phone & then navigated to second activity.
Then I went to first app & cliked the button to launch the second
app by passing some bundle as below .
//my code
Intent intent = new Intent("android.intent.action.MAIN");
intent.addCategory("android.intent.category.LAUNCHER");
intent.setComponent(new ComponentName(com.secondapp,
secondapplauncheractivity));
intent.putExtra("bundlekey", "bundlevalue");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Above code resumed the second app but I am not getting any bundle
in the intent of the second app.
I overidden lifecycle methods in the second app to check for this
bundle by calling below code --
//my code
Intent i = this.getIntent();
if(i != null ){
Bundle b = i.getExtras();
if(b!= null && b.containsKey("bundlekey")){
Log.i("TAG", "found bundle===================");
}
}
I tested the above scenario in google nexus 4.1.2 android version
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en