-6

I want to open an application from my app and then press one of its button as it opens.

2 Answers2

3

Assuming you know the package name of the application, You can use the following code below

  Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
  startActivity(launchIntent);
Vinay Jayaram
  • 1,030
  • 9
  • 29
0

Launch an application from another application on Android to start the other application you can then pass data in the intent such as

Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
startActivity(launchIntent);

intent.launchIntent("PushButtonId", buttonId);
startActivity(intent)

Then retrieve datas int the started app

String text = myIntent.getStringExtra("PushButtonId");
Community
  • 1
  • 1
Lary Ciminera
  • 1,270
  • 8
  • 15
  • This will only work if you have access to the source code of the application that is to be opened, and know that the intent will be used to perform an action. This is _not_ a general solution to the question as one does not exist. – Ed Holloway-George May 19 '15 at 10:12
  • yes you are right, i may have made too many assumption from this short answer. – Lary Ciminera May 19 '15 at 10:18