我正在尝试在 google play 中上传 android 应用程序 (.apk),是否需要在付费应用程序中拥有 (.apk) 的许可证密钥。如果是,为什么需要它?
MyLicenseCheckerCallback 抛出它应该实现然后超类型方法的错误。它说允许()必须传递一个整数参数,其中的参数应该传递你能建议我帮忙吗?
private class MyLicenseCheckerCallback implements LicenseCheckerCallback {
@Override
public void allow() {
if (isFinishing()) {
// Don't update UI if Activity is finishing.
return;
}
// Should allow user access.
startMainActivity();
}
@Override
public void applicationError(ApplicationErrorCode errorCode) {
if (isFinishing()) {
// Don't update UI if Activity is finishing.
return;
}
// This is a polite way of saying the developer made a mistake
// while setting up or calling the license checker library.
// Please examine the error code and fix the error.
toast("Error: " + errorCode.name());
startMainActivity();
}
@Override
public void dontAllow() {
if (isFinishing()) {
// Don't update UI if Activity is finishing.
return;
}
// Should not allow access. In most cases, the app should assume
// the user has access unless it encounters this. If it does,
// the app should inform the user of their unlicensed ways
// and then either shut down the app or limit the user to a
// restricted set of features.
// In this example, we show a dialogue that takes the user to Market.
showDialog(0);
}
}