How to change Android App package name in eclipse?
解決方案如下:
final PackageManager packageManager = getPackageManager(); ListmPackageInfo = packageManager.getInstalledPackages(0); for (int i = 0; i < mPackageInfo.size(); i++) { //獲取到AP包名 if (mPackageInfo.get(i).packageName.equals("com.google.android.apps.plus")) { isInstalling = true; break; } }
String sParam = "com.google.android.apps.plus";
try
{
// Open app with Google Play app
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id="+sParam));
startActivity(intent);
}
catch (android.content.ActivityNotFoundException anfe)
{
// Open Google Play website
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id="+sParam));
startActivity(intent);
}