Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/197.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Dropbox核心API_Android_Dropbox Api - Fatal编程技术网

Android Dropbox核心API

Android Dropbox核心API,android,dropbox-api,Android,Dropbox Api,我正在使用核心API将我的应用程序链接到dropbox。当我安装并启动应用程序时,我的onResume()将被触发。然后显示dropbox链接屏幕。当我按下Allow时,我的onResume()将永远不会被触发,活动将立即关闭 以下是我在AndroiManifest.xml <activity android:name="com.example.DeviceCheck" android:label="@string/app_name" <intent-filter&g

我正在使用核心API将我的应用程序链接到dropbox。当我安装并启动应用程序时,我的
onResume()
将被触发。然后显示dropbox链接屏幕。当我按下
Allow
时,我的
onResume()
将永远不会被触发,活动将立即关闭

以下是我在
AndroiManifest.xml

<activity android:name="com.example.DeviceCheck"
    android:label="@string/app_name"
    <intent-filter>
        <action android:name="android.intent.action.MAIN />
        <category android:name="android.intent.category.LAUNCHER />
    </intent-filter>
</activity>

Log.d(…)
不会第二次显示。你们有什么建议吗?提前谢谢你

当应用程序关闭时,logcat会显示什么?@JustinJasmann什么都没有,甚至连onResume中的日志都没有,它只是关闭而不再返回活动。令人困惑的母亲有没有
Activity.finish()
在任何地方被调用?@JustinJasmann没有,我查了又查。我调用finish()的唯一位置是当我导航到另一个活动并希望关闭此活动时
@Override
protected void onResume() {
    Log.d("ON_RESUME","true");
    super.onResume();
    AndroidAuthSession session = dropbox.getSession();
    if (session.authenticationSuccessful()) {
        try {
            session.finishedAuthentication();
            TokenPair tokens = session.getAccessTokenPair();
            SharedPreferences prefs = getSharedPreferences(DROPBOX_NAME, 0);
            Editor editor prefs.edit();
            editor.putString(ACCESS_KEY, tokens.key);
            editor.putString(ACCESS_SECRET, tokens.secret);
            editor.commit();

            loggedIn(true);
        } catch (IllegalStateException e){
            Toast.makeText(this, "Error during Auth..", Toast.LENGHT_LONG).show();
        }
    }
}