Android Dropbox核心API
我正在使用核心API将我的应用程序链接到dropbox。当我安装并启动应用程序时,我的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
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();
}
}
}