You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ResultReceiverchaseResultReceiver =
newResultReceiver(mUiThreadHandler) {
@OverrideprotectedvoidonReceiveResult(intresponseCode, BundleresultData) {
// Here you guys store the BroadcastManager which in turn stores the PurchasesUpdatedListenermBroadcastManager.getListener().onPurchasesUpdated(responseCode, purchases);
}
};
Then you guys send that stored PurchasesUpdatedListener to the ProxyBillingActivity to be used as a callback. That doesn't work of course if the client context is changed with a rotation for example. So then what happens is the onPurchasesUpdated method gets called on an old context instance which is a memory leak and can cause crashes in the client app.
My proposed solution would be to use the custom action and BroadcastReceiver setup you guys have going. So basically instead of sending that ResultReceiver to the ProxyBillingActivity, you guys would just send a broadcast:
Inside
launchBillingFlow
, you guys do this:Then you guys send that stored
PurchasesUpdatedListener
to theProxyBillingActivity
to be used as a callback. That doesn't work of course if the client context is changed with a rotation for example. So then what happens is theonPurchasesUpdated
method gets called on an old context instance which is a memory leak and can cause crashes in the client app.My proposed solution would be to use the custom action and
BroadcastReceiver
setup you guys have going. So basically instead of sending thatResultReceiver
to theProxyBillingActivity
, you guys would just send a broadcast:Mirrored on the Google Issue Tracker: https://issuetracker.google.com/issues/63267470.
The text was updated successfully, but these errors were encountered: