繁体   English   中英

适用于Android的Dropbox Sync API-无法启动活动

[英]Dropbox Sync API for Android - Unable to start activity

我试图在Android应用程序(使用Android Studio)中使用Dropbox Sync API。

我遵循此链接上的步骤:

https://www.dropbox.com/developers/sync/start/android

并按照以下说明配置IDE:

https://www.dropbox.com/developers/blog/57/using-the-sync-api-with-android-studio

但是在运行时,当我打电话给:

DbxAccountManager mDbxAcctMgr = DbxAccountManager.getInstance(getApplicationContext(), APP_KEY, APP_SECRET);

(显然APP_KEY和APP_SECRET设置正确)我收到:

com.dropbox.sync.android.DbxRuntimeException$BadState: Required Sync API Activity isn't included in application manifest: com.dropbox.client2.android.AuthActivity, com.dropbox.sync.android.DbxAuthActivity

我该怎么办

谢谢!

根据教程,您必须在清单中的元素内进行设置:

    <activity android:name="com.dropbox.sync.android.DbxAuthActivity" />
  <activity
  android:name="com.dropbox.client2.android.AuthActivity"
 android:launchMode="singleTask" >
<intent-filter>
<data android:scheme="db-APP_KEY" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
  </intent-filter>
</activity>
 <service
  android:name="com.dropbox.sync.android.DbxSyncService"
  android:enabled="true"
  android:exported="false"
  android:label="Dropbox Sync" />

这是为了声明DropBox活动,该活动将为用户登录打开。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM