mardi 17 mars 2015

i want to use shared preference in the onpurchaseresponse() of SamplepurchaseListener.java of inapppurchasing via amazon.


Vote count:

0




when case is successful i want to edit the variable value and then i want to use this value in other class of my project. how can i do it? kindly suggest me?


switch (status) { case SUCCESSFUL:



SamplePurchasingListener.this.runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
SharedPreferences.Editor editor = getSharedPreferences(MY_PREFS_NAME, MODE_WORLD_READABLE).edit();
editor.putBoolean("PREMIUM", true); // Storing boolean - true/false
editor.commit();
}
});

final Receipt receipt = response.getReceipt();
iapManager.setAmazonUserId(response.getUserData().getUserId(), response.getUserData().getMarketplace());
Log.d(TAG, "onPurchaseResponse: receipt json:" + receipt.toJSON());
iapManager.handleReceipt(response.getRequestId().toString(), receipt, response.getUserData());
iapManager.refreshLevel2Availability();

break;
case ALREADY_PURCHASED:


Log.i(TAG,
"onPurchaseResponse: already purchased, you should verify the entitlement purchase on your side and make sure the purchase was granted to customer");

break;


asked 1 min ago







i want to use shared preference in the onpurchaseresponse() of SamplepurchaseListener.java of inapppurchasing via amazon.

Aucun commentaire:

Enregistrer un commentaire