问题
All my apps have the same sharedUserId. I would like to start a class of another app using the class of my current app. I want to use intent extras but I do not want to use intent URLs. I also would prefer not to have to change the AndroidManifest of my target activity's app.
回答1:
Its pretty easy since you have the sharedUserId set.
Intent res = new Intent();
String mPackage = "com.your.package";
String mClass = ".actYouAreLaunching";
res.setComponent(new ComponentName(mPackage,mPackage+mClass));
startActivity(res);
And that's all there is to it. You can add intent extras like you normally would.
来源:https://stackoverflow.com/questions/4770847/android-intents-start-activity-using-class-name-from-another-app-that-has-the-s