我试过这个小代码,但实际上并不是我想要的。
Intent intent = getPackageManager().getLaunchIntentForPackage(packageName);
if (intent!=null) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
else {
//Log.d("NULL", "NULL");
Uri uri = Uri.parse("http://play.google.com/store/apps/details? id=packageName");
Intent go = new Intent(Intent.ACTION_VIEW, uri);
startActivity(go);
}