Skip to content

Commit

Permalink
Solved problem for "IAB Helper" not setup
Browse files Browse the repository at this point in the history
In some devices, when a users clicks the button in order to make a donation, this exception is thrown because that Google Play may is not active or similar.
As this is managed by the lib, the user finds "impossible" (except by doing this trick: https://pastebin.com/Wda6FwPz) to catch and handle the exception.
  • Loading branch information
Javinator9889 committed Mar 9, 2018
1 parent b904ce0 commit 30b1c20
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,15 @@ public void onActivityCreated(Bundle savedInstanceState) {

@Override
public void onClick(View v) {
donateGoogleOnClick(v);
try {
donateGoogleOnClick(v);
} catch (IllegalStateException e) { // In some devices, it is impossible to setup IAB Helper
if (mDebug) // and this exception is thrown, being almost "impossible"
Log.e(TAG, e.getMessage()); // to the user to control it and forcing app close.
openDialog(android.R.drawable.ic_dialog_alert,
R.string.donations__google_android_market_not_supported_title,
getString(R.string.donations__google_android_market_not_supported));
}
}
});

Expand Down

0 comments on commit 30b1c20

Please sign in to comment.