跳转到另一个app


跳转到另一个app

1
2
3
4
5
6
7
8
9
10
11
12
13
14
try{
PackageManager packageManager = ctx.getPackageManager();
Intent intent = packageManager.getLaunchIntentForPackage("com.wogame.ProductName");
if (intent != null) {
ComponentName comp = new ComponentName("com.wogame.ProductName", "com.wogame.ProductName.UnityPlayerActivity");
intent.setAction("android.intent.action.VIEW");
intent.setComponent(comp);
ctx.startActivity(intent);
}else{
Toast.makeText(getApplicationContext(), "哟,赶紧下载安装这个APP吧", Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
e.printStackTrace();
}