【问题标题】:Dropbox Sync API for Android - Unable to start activity适用于 Android 的 Dropbox Sync API - 无法启动活动
【发布时间】:2014-09-29 11:16:37
【问题描述】:

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

我按照此链接中的步骤操作:

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

我该怎么办?

谢谢!

【问题讨论】:

    标签: android android-studio dropbox dropbox-api


    【解决方案1】:

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

        <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 Activity,它将为用户登录而打开。

    【讨论】:

    • 非常感谢,您解决了我的问题!你能告诉我你指的是哪个教程吗?再次感谢!!! :)
    • 欢迎您...这是在同一教程的“安装 sdk”部分:dropbox.com/developers/sync/sdks/android
    • 好的,我错过了整个“安装 SDK”部分,谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多