This is my app A and have a string value "Hello" . I want to send this string value to app B.
String mystring = "Hello";
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.example.test");
if (launchIntent != null) {
launchIntent.putExtra("success", mystring);
startActivity(launchIntent);
}
This is my app B
Bundle b = getIntent().getExtras();
if (b != null) {
String myString = b.getString("success");
Toast.makeText(MainActivity.this, "" + myString, Toast.LENGTH_SHORT).show();
}
On the receiving "app B" myString
is received as null
.