基本上评级代码应该从android端处理。下面是代码:
public static void showRateDialog(final Context mContext) {
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setMessage(
"If you enjoy using "
+ APP_TITLE
+ ", please take a moment to rate it. Thanks for your support!")
.setTitle("Rate " + APP_TITLE)
.setCancelable(false)
.setIcon(R.drawable.ic_launcher)
.setPositiveButton("Rate TempleRun2",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
mContext.startActivity(new Intent(
Intent.ACTION_VIEW,
Uri.parse("https://play.google.com/store/apps/details?id=com.imangi.templerun2")));
dialog.dismiss();
}
})
.setNegativeButton("Remind me later",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
})
.setNeutralButton("No\nThanks",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
希望这可以帮助。