1

Possible Duplicate:
Starting One Android App from Another App

We are developing an android application let say com.example.helloone and another android application com.test.hellocalled.Here both are two different packages,i want to call com.test.hellocalled application from com.example.helloone.Can you suggest regarding same?

Community
  • 1
  • 1
Jamili Reddy
  • 39
  • 1
  • 5
  • Asked many times. Please use the [search](http://stackoverflow.com/search?q=starting+another+app+from+my+app+in+Android) feature before posting new questions. – Mudassir Jun 20 '11 at 07:39
  • That one http://stackoverflow.com/questions/2728465/how-to-call-one-android-application-from-another-android-application is older and better – Gangnus Jan 30 '14 at 11:01

3 Answers3

4

In your activity, you can use

if(isAppInstalled("com.other.package"))
{
    Intent nextIntent = new Intent(Intent.ACTION_MAIN);
    nextIntent.setComponent(new ComponentName("com.other.package","com.other.package.Activity"));
    startActivity(nextIntent);
}
Thunder Rabbit
  • 5,163
  • 7
  • 41
  • 79
  • Sorry what exactly i mean that whether one application launch other application of android . Tried the above case but did not work out.. – Jamili Reddy Jun 20 '11 at 11:24
  • This question has been closed as a duplicate; if your actual question is different, please ask again, but make sure to explain clearly what is different about your situation. – Thunder Rabbit Jun 20 '11 at 14:59
1

I'm not sure how to tag something as a repeat, but a quick google search brings up this question which is the same as yours.

Community
  • 1
  • 1
Nick
  • 599
  • 2
  • 8
0

Either u can start an activity with an Intent that is similar to the one of the application that you wish to launch or u can launch the application using its file path as shown below:

Intent intent=new Intent();
 intent.setAction(android.content.Intent.ACTION_VIEW);
 intent.setDataAndType(Uri.parse("file:///sdcard/the full path to your file"), "application/vnd.android.package-archive");          "application/vnd.android.package-archive");
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

context.startActivity(intent);

Nitin
  • 1,415
  • 13
  • 16