6

In Android app how programmatically discover what app has started my app?

I think it should be in MyApplication that extends Application, but it has no clues.

However inside Activity I could call getIntent() and if the calling app is polite to give such info, I would get it via intent.getStringExtra()

Is there general approach that would not have requirements for calling apps to provide self info?

In other app developer would call as

Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.company.myapp");
startActivity(LaunchIntent);

see Launch an application from another application on Android and Open another application from your own (intent)

UPDATE: I have wrote an app that launches my app and indeed the only way is to put Extra data into Intent as the intent has only "android.intent.action.MAIN" , "android.intent.category.LAUNCHER" and package of launched app.

Community
  • 1
  • 1
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
  • I think it's impossible, at least according to [this answer](http://stackoverflow.com/questions/7199727/android-find-the-sender-of-an-intent-for-a-monitoring-application). – kamituel Jan 26 '15 at 10:57

0 Answers0