[英]android usage of “controller.query(activity);” in scoreloop
i am attempting to implement a built in controller that is part of the scoreloop library. 我正在尝试实现一个内置的控制器,该控制器是scoreloop库的一部分。 the documentation states:
文档指出:
Basic Usage: 基本用法:
To invoke the TOS dialog if it was not accepted previously, the following code may be used: 要调用TOS对话框(如果先前未接受),可以使用以下代码:
final TermsOfServiceController controller = new TermsOfServiceController(new TermsOfServiceControllerObserver() {
@Override
public void termsOfServiceControllerDidFinish(final TermsOfServiceController controller, final Boolean accepted) {
if(accepted != null) {
// we have conclusive result.
if(accepted) {
// user did accept
}
else {
// user did reject
}
}
}
});
controller.query(activity);
but when i paste this into my code i get the following syntax errors: 但是,当我将其粘贴到代码中时,出现以下语法错误:
am i using this incorrectly? 我使用不正确吗? how and where would this be used any ideas?
任何想法将在何处使用?
EDIT: after moving the statement to the method where i want to show the dialog i now get the following error: 编辑:将语句移到要显示对话框的方法后,我现在得到以下错误:
You seem to be calling controller.query(activity)
in a class body where a declaration is expected. 您似乎在需要声明的类主体中调用
controller.query(activity)
。 Move the statement controller.query(activity)
to a method where you would like to show the dialog. 将语句
controller.query(activity)
移至要显示对话框的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.