How do I get intent extras from an app that launches another app?

I am trying to send data from one app to another. The mother app will launch the child app using this

Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.example.stuff");
LaunchIntent.putExtra("Stuffkey", "blahblah");
startActivity(LaunchIntent);

What do I have to write in the child app so that it can read the extra?

Upvotes: 1

Views: 2074

Answers (1)

greywolf82
greywolf82

Reputation: 22173

You need to call getIntent() in the onCreate() method of the main activity of the second app. After that you can call getStringExtra() on the intent to get the parameter.

Upvotes: 2

Related Questions