我正在尝试程序内弹出评论我的银河商店应用程序第一次。根据Galaxy (https://developer.samsung.com/galaxy-store/customer-review/galaxy-store-review-broadcast.html)提供的文档,我执行了每个步骤,并在激发项目时得到了这个错误。
下面是我在MainActivity.java中实现的代码:
ApplicationInfo ai =
getPackageManager().getApplicationInfo("com.sec.android.app.samsungapps",
PackageManager.GET_META_DATA);
int inappReviewVersion = ai.metaData.getInt("com.sec.android.app.samsungapps.review.inappReview", 0);
if (inappReviewVersion > 0){
// if inappReviewVersion is larger than zero, Galaxy Store supports in-app review function
} else {
// else, Galaxy Store does not support in-app review function
}
// 1. Check your review authority by Galaxy Store package
Intent intent = new Intent("com.sec.android.app.samsungapps.REQUEST_INAPP_REVIEW_AUTHORITY");
intent.setPackage("com.sec.android.app.samsungapps");
intent.putExtra("callerPackage", com.protecgames.htmleditor); // targetPacakge : your package name
sendBroadcast(intent);
Intent intent = new Intent();
intent.setData(Uri.parse(samsungapps://AppRating/com.protecgames.htmleditor)); // deeplinkUri, included in response intent
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
startActivity(intent);以下是我遇到的错误:
1. ERROR in /storage/emulated/0/.sketchware/mysc/603/app/src/main/java/com/protecgames/htmleditor/MainActivity.java (at line 184)
intent.setData(Uri.parse(samsungapps://AppRating/com.protecgames.htmleditor)); // deeplinkUri, included in response intent
^
Syntax error, insert ")" to complete MethodInvocation
----------
2. ERROR in /storage/emulated/0/.sketchware/mysc/603/app/src/main/java/com/protecgames/htmleditor/MainActivity.java (at line 184)
intent.setData(Uri.parse(samsungapps://AppRating/com.protecgames.htmleditor)); // deeplinkUri, included in response intent
^
Syntax error, insert ")" to complete MethodInvocation
----------
3. ERROR in /storage/emulated/0/.sketchware/mysc/603/app/src/main/java/com/protecgames/htmleditor/MainActivity.java (at line 184)
intent.setData(Uri.parse(samsungapps://AppRating/com.protecgames.htmleditor)); // deeplinkUri, included in response intent
^
Syntax error, insert ";" to complete Statement
----------
3 problems (3 errors)我使用的语言是Java
发布于 2022-05-02 04:29:49
您应该将数据添加为字符串,而不是包或我们所说的任何内容。尝试以这种方式设置数据:
intent.setData(Uri.parse("samsungapps://AppRating/com.protecgames.htmleditor")); https://stackoverflow.com/questions/72082026
复制相似问题