android - onIabPurchaseFinished never called. -
i've been trying set in-app billing first app, , have been using android.test.purchased sku. purchase come through, , manage sku inventory, but, title says, oniabpurchasefinished, never called.
i think may have log: "couldn't save view has focus because focused view com.android.internal.policy.impl.phonewindow$decorview@406743d0 has no id". pops up, right before going of google play. i'm not sure means though...
launching purchase:
mhelper.launchpurchaseflow(this, sku, 10001, mpurchasefinishedlistener, "");
and listener:
iabhelper.oniabpurchasefinishedlistener mpurchasefinishedlistener = new iabhelper.oniabpurchasefinishedlistener() { @override public void oniabpurchasefinished(iabresult result, purchase info) { system.out.println("purchase finish heard something"); if (result.isfailure()) { log.d(tag, "error purchasing: " + result); return; } else{ log.d(tag,"success!"); } } };
try adding activity calls mhelper.launchpurchaseflow(..)
:
@override protected void onactivityresult(int requestcode, int resultcode, intent data) { log.d(tag, "onactivityresult(" + requestcode + "," + resultcode + "," + data); // pass on activity result helper handling if (!mhelper.handleactivityresult(requestcode, resultcode, data)) { // not handled, handle ourselves (here's you'd // perform handling of activity results not related in-app // billing... super.onactivityresult(requestcode, resultcode, data); } else { log.d(tag, "onactivityresult handled iabutil."); } }
android in-app-billing
No comments:
Post a Comment