我希望在另一个应用中开始一项特定的活动。我可以使用以下内容启动应用程序的主要活动,但我似乎无法启动所需的活动(screenshare.ScreenShareActiviy)
Intent i;
PackageManager manager = getPackageManager();
Toast.makeText(this, "ScreenCast", Toast.LENGTH_LONG).show();
try {
i = manager.getLaunchIntentForPackage("com.google.glass.companion");
// i = manager.getLaunchIntentForPackage("com.google.glass.companion.screenshare.ScreenshareActivity");
if (i == null)
throw new PackageManager.NameNotFoundException();
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);
} catch (PackageManager.NameNotFoundException e) {
}