void resolveConnectionResult() {
// Try to resolve the problem
checkState(TYPE_GAMEHELPER_BUG, "resolveConnectionResult",
"resolveConnectionResult should only be called when connecting. Proceeding anyway.",
STATE_CONNECTING);
if (mExpectingResolution) {
debugLog("We're already expecting the result of a previous resolution.");
return;
}
Log.d("b4a", "resolveConnectionResult");
debugLog("resolveConnectionResult: trying to resolve result: " + mConnectionResult);
if (mConnectionResult.hasResolution()) {
// This problem can be fixed. So let's try to fix it.
debugLog("Result has resolution. Starting it.");
// launch appropriate UI flow (which might, for example, be the
// sign-in flow)
// First, call B4a ION listener
ion = new IOnActivityResult() {
@Override
public void ResultArrived(int resultCode, Intent intent) {
showAlert("B4a", " " + resultCode);
BResult(resultCode);
}
};
BA pba = mba.processBA; //Create process variable....must ask later
try {
pba.startActivityForResult(ion, null); //<-- passing null instead of an intent
} catch (NullPointerException npe) {
//required...
}
try {
mExpectingResolution = true;
mConnectionResult.startResolutionForResult(mActivity, RC_RESOLVE);
} catch (SendIntentException e) {
// Try connecting again
debugLog("SendIntentException, so connecting again.");
connectCurrentClient();
}
} else {
// It's not a problem what we can solve, so give up and show an
// error.
debugLog("resolveConnectionResult: result has no resolution. Giving up.");
giveUp(new SignInFailureReason(mConnectionResult.getErrorCode()));
}
}