1

I have two separate apps. the packages are as follows:

com.example.incrediblemachine.rnt

com.example.incrediblemachine.palpal

i would like to do the following:

when clicked on a button on the rnt app, i want the palpal app to open. is there any way to do this?

Community
  • 1
  • 1
Ram Kumar
  • 23
  • 3
  • Quesition is duplicate...http://stackoverflow.com/questions/3872063/launch-an-application-from-another-application-on-android- Refer this – learner Mar 05 '16 at 07:19

1 Answers1

1

Use getLaunchIntentForPackage method in your Button onClick() . Before that install com.example.incrediblemachine.palpal app in device /emulator.

Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.example.incrediblemachine.palpal");
startActivity(launchIntent);

}
});
sasikumar
  • 10,919
  • 2
  • 21
  • 42