在调用startIntentSenderForResult后,onActivityResult有错误的requestCode

时间:2016-05-23 13:48:03

标签: android google-drive-api onactivityresult

这是我的fragmnet中的代码。 原始requestCode是:2

     GoogleApiClient mGoogleApiClient;

mGoogleApiClient = new GoogleApiClient.Builder(getActivity())
                .addApi(Drive.API)
                .addScope(Drive.SCOPE_FILE)
                .addConnectionCallbacks(new GoogleConnectionCallbacks())
                .addOnConnectionFailedListener(new GoogleonnectionFailedListener())
                .build();

            int a = 2;
            IntentSender intentSender = Drive.DriveApi
                        .newOpenFileActivityBuilder()
                        .build(mGoogleApiClient);
            getActivity().startIntentSenderForResult(intentSender, a, null, 0, 0, 0);

包含我的片段的活动中的代码:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {

}

现在requestCode是:131074。 为什么我没有得到requestCode = 2?

0 个答案:

没有答案