I had the same problem when I was switching from different versions of api. I had two instances of AuthActivity in the AndroidManifest.xml file, i.e.
<activity android:name="com.dropbox.client2.android.AuthActivity" android:configChanges="orientation|keyboard" android:launchMode="singleTask" > <intent-filter> <data android:scheme="xxxxxxxxxxx" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name="com.dropbox.core.android.AuthActivity" android:configChanges="orientation|keyboard" android:launchMode="singleTask"> <intent-filter> <data android:scheme="db-xxxxxxxxxx" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>
I found this after some debugging and noticed that the Dropbox library checked the connection check. If dropbox detects more than one action, if it throws a security warning error. I duplicated the same check with the code below and put it in the main launch action. It will print out actions found with the same intent as a clue about what is happening.
public static void showDropboxActivities(Context context) { Intent testIntent = new Intent(Intent.ACTION_VIEW); String scheme = "db-" + DROPBOX_APP_KEY; String uri = scheme + "://" + com.dropbox.core.android.AuthActivity.AUTH_VERSION + "/connect"; testIntent.setData(Uri.parse(uri)); PackageManager pm = context.getPackageManager(); List<ResolveInfo> activities = pm.queryIntentActivities(testIntent, 0); Log.d("SomeApp", "------------- showDropboxActivities ------------"); for (ResolveInfo activity : activities) { Log.d("SomeApp", "activty = " + activity.toString()); Log.d("SomeApp", "activity.activityInfo = " + activity.activityInfo); Log.d("SomeApp",".............."); } }
source share