Uncaught exception in background thread Thread[IntentService[PicasaSyncConnectivityAsync],5,main]
java.lang.NullPointerException
at cit.a(ProGuard:258)
at cit.<init>(ProGuard:198)
at cit.a(ProGuard:189)
at com.google.android.picasasync.ConnectivityReceiver$AsyncService.onHandleIntent(ProGuard:38)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.os.HandlerThread.run(HandlerThread.java:60)
FATAL EXCEPTION: IntentService[PicasaSyncConnectivityAsync]
java.lang.NullPointerException
at cit.a(ProGuard:258)
at cit.<init>(ProGuard:198)
at cit.a(ProGuard:189)
at com.google.android.picasasync.ConnectivityReceiver$AsyncService.onHandleIntent(ProGuard:38)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.os.HandlerThread.run(HandlerThread.java:60)
有时我在ConnectionResult中得到Null指针异常。
@Override
public void onConnectionFailed(ConnectionResult result) {
if (!mGooglePlusIntentInProgress && result.hasResolution()) {
try {
mIntentInProgress = true;
result.startResolutionForResult(getActivity(), ShareHelper.GOOGLE_PLUS_SIGN_IN);
} catch (SendIntentException e) {
// The intent was canceled before it was sent. Return to the default
// state and attempt to connect to get an updated ConnectionResult.
mIntentInProgress = false;
mGoogleApiClient.connect();
}
}
}
所以我尝试捕获Null指针Exception。
@Override
public void onConnectionFailed(ConnectionResult result) {
if (!mGooglePlusIntentInProgress && result != null && result.hasResolution()) {
try {
mIntentInProgress = true;
result.startResolutionForResult(getActivity(), ShareHelper.GOOGLE_PLUS_SIGN_IN);
} catch (SendIntentException e) {
// The intent was canceled before it was sent. Return to the default
// state and attempt to connect to get an updated ConnectionResult.
mIntentInProgress = false;
mGoogleApiClient.connect();
} catch (NullPointerException e) {
Log.e(LOG_TAG, "Exception is : " + e.getMessage());
}
}
}
即使在捕获异常之后,Google plus也会有力量关闭。这是google plus的问题吗?