Google Plus在无网络和重启时共享问题

时间:2014-05-31 06:29:14

标签: android google-plus google-play-services

当我重新启动Android设备或在通过google plus分享任何帖子时关闭网络时,Google Plus会关闭。

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的问题吗?

0 个答案:

没有答案