我创建了一个alertdialog框,显示用户第一次点击我的应用时,我想知道的是如何将应用指向我在Play商店中的应用并保存所选内容以便框不会再次出现。请帮忙,谢谢!
AlertDialog.Builder b= new AlertDialog.Builder(this)
.setTitle("Review and Rate Converjz!")
.setMessage("Click on OK to review and rate Converjz, your feedback" +
"and ratings are greatly apreciated! We need your help to improve our app in order to provide you with a better" +
" experience. Thanks!")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
}
)
.setNegativeButton("CANCEL",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
dialog.cancel();
}
}
);
b.show();
答案 0 :(得分:1)
以下是如何在Play商店中链接到您的应用:
Uri uri = Uri.parse("market://details?id=" + getPackageName());
Intent openPlayStore = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(openPlayStore);
} catch (ActivityNotFoundException e) {
Toast.makeText(mActivity, " unable to find market app", Toast.LENGTH_LONG).show();
}
您无法保存用户评分或评分的内容,但您可以保存您要求评分的SharedPreferences
答案 1 :(得分:0)
您可以使用自己制作的链接打开Play商店链接,并将该用户操作信息保存在共享首选项中。但是开发人员的共同要求因此使用以下库 -
https://github.com/fernandodev/easy-rating-dialog
https://github.com/hotchemi/Android-Rate
希望能解决问题。