We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Deepu R.
11 years agoNew member | Level 1
onActivityresult() not being invoked after choosing file using Dropbox Chooser
Hi, I am trying to use the Dropbox Chooser Api in android app to allow the user to choose files from Dropbox. I was able to launch the Dropbox Chooser successfully from the android app, but after se...
Deepu R.
11 years agoNew member | Level 1
Hi Gregory,
- The Android SDK version is 1.0.1.
- Currently I'm trying to integrate Dropbox Chooser as a cordova plugin in to my app.
So in the plugin java file indside execute() method I've added the following lines of code:-
cordova.setActivityResultCallback(DropboxPlugin.this);
mChooser = new DbxChooser(APP_KEY);
mChooser.forResultType(DbxChooser.ResultType.PREVIEW_LINK)
.launch(this.cordova.getActivity(), DBX_CHOOSER_REQUEST);
And I've overridden onActivityresult() method.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
System.out.println("------Inside onActivityResult ------");
if (requestCode == DBX_CHOOSER_REQUEST) {
if (resultCode == Activity.RESULT_OK) {
DbxChooser.Result result = new DbxChooser.Result(data);
String fileName = result.getName();
}
}
else {
super.onActivityResult(requestCode, resultCode, data);
}
}
But now I can observe that for the first time, after launching the Dropbox Chooser and choosing a file, the onActivityResult() is never being invoked.
From the second time onwards, the onActivityResult() method is getting invoked even before the Dropbox Chooser is launched.
Please provide any inputs on this issue.
Let me know if you want any further inputs from me.
Thanks,
Deepu
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!