user1758604
user1758604

Reputation: 11

how to launch other application with different process from my application

I would to like to ask how to launch other application with different processes from my application?

mIntent = mContext.getPackageManager().getLaunchIntentForPackage(facebook package name);
mIntent.setAction(Intent.ACTION_MAIN);
mIntent.addCategory(Intent.CATEGORY_LAUNCHER);
mContext.startActivity( mIntent );

As above codes, I found that the facebook uses the same process as my application. I would like to know that it is possible the facebook can be called with other process.

Upvotes: 0

Views: 211

Answers (2)

Ziteng Chen
Ziteng Chen

Reputation: 1969

To my knowledge the app in another apk will by default run in its own process. I guess when you say 'process' you mean 'task', if this is the case you can set the FLAG_ACTIVITY_NEW_TASK flag to the intent like this "mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);"

Upvotes: 1

njzk2
njzk2

Reputation: 39386

Unless you have the same sharedUserId and the same signature as the app you are launching, you are launching it is a different process. You cannot launch it in the same process even if you wanted to.

Upvotes: 2

Related Questions