【发布时间】:2012-03-06 14:52:19
【问题描述】:
RESTORE_TRANSATION 代码有一个大问题。我不明白如何在我的应用程序中实现恢复。代码如下:
restoButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (BillingHelper.isBillingSupported()) {
BillingHelper.restoreTransactionInformation(BillingSecurity
.generateNonce());
if( **HERE** ){
//restore
SharedPreferences settings = getSharedPreferences(ValoriApp.confName, ValoriApp.mode);
SharedPreferences.Editor editor = settings.edit();
editor.putInt("PRO", 1);
editor.commit();
Toast.makeText(getApplicationContext(), getString(R.string.toast_restore), Toast.LENGTH_SHORT);
finish();
startActivity(intentback);
}
else{
Toast.makeText(getApplicationContext(), getString(R.string.toast_norestore), Toast.LENGTH_LONG);
Log.e("RESTORE", "restore transation failed(2)");
}
}
else{
Toast.makeText(getApplicationContext(), getString(R.string.toast_norestore), Toast.LENGTH_LONG);
Log.e("RESTORE", "restore transation failed");
}
}
});
我不知道在第二个if 的HERE 中输入什么。怎么了?
【问题讨论】:
-
可能 [this][1] 将帮助您 [1]:stackoverflow.com/questions/8638665/…
标签: android in-app-purchase restore