并解释何时使用这些。就像我可以使用这个代码评级自己的应用程序
Uri uri = Uri.parse("market://details?id=" + getApplication().getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
// To count with Play market backstack, After pressing back button,
// to taken back to our application, we need to add following flags to intent.
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY |
Intent.FLAG_ACTIVITY_NEW_DOCUMENT |
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
try {
startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://play.google.com/store/apps/details?id=" + getApplication().getPackageName())));
}
如果没有这个,我的应用程序也能正常工作。我是 Android 新手,如果我问错了,抱歉。谢谢
慕码人8056858
相关分类