We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Nicolas L.
11 years agoNew member | Level 1
Download file from Dropbox to local android Java
I spent some days on this code without finding the solution. Could you help me please?
I want to download a file from a Dropbox account to the application storage (local memory). When I open the f...
Nicolas L.
11 years agoNew member | Level 1
Hello Steve,
Thank you for your answer. Actually the program import first the files to the local folder then it open the files. These files are database files.
The program crashes because it cannot find the local files. But this problem occurs only after the first run. I mean if I uninstall the application then I re install, it crashes. But if I just restart after the crash, it works, the local files were downloaded.
Here the error stack trace:
12-31 10:07:46.461: E/AndroidRuntime(24240): FATAL EXCEPTION: main
12-31 10:07:46.461: E/AndroidRuntime(24240): Process: com.wataiso.labnotebook, PID: 24240
12-31 10:07:46.461: E/AndroidRuntime(24240): java.lang.RuntimeException: Unable to resume activity {com.wataiso.labnotebook/com.wataiso.labnotebook.TableauDeBord}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
12-31 10:07:46.461: E/AndroidRuntime(24240): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2791)
12-31 10:07:46.461: E/AndroidRuntime(24240): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2820)
12-31 10:07:46.461: E/AndroidRuntime(24240): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1241)
12-31 10:07:46.461: E/AndroidRuntime(24240): at android.os.Handler.dispatchMessage(Handler.java:102)
12-31 10:07:46.461: E/AndroidRuntime(24240): at android.os.Looper.loop(Looper.java:136)
12-31 10:07:46.461: E/AndroidRuntime(24240): at android.app.ActivityThread.main(ActivityThread.java:5050)
12-31 10:07:46.461: E/AndroidRuntime(24240): at java.lang.reflect.Method.invokeNative(Native Method)
12-31 10:07:46.461: E/AndroidRuntime(24240): at java.lang.reflect.Method.invoke(Method.java:515)
12-31 10:07:46.461: E/AndroidRuntime(24240): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:805)
12-31 10:07:46.461: E/AndroidRuntime(24240): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:621)
12-31 10:07:46.461: E/AndroidRuntime(24240): at dalvik.system.NativeStart.main(Native Method)
12-31 10:07:46.461: E/AndroidRuntime(24240): Caused by: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
12-31 10:07:46.461: E/AndroidRuntime(24240): at android.database.AbstractCursor.checkPosition(AbstractCursor.java:426)
12-31 10:07:46.461: E/AndroidRuntime(24240): at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
12-31 10:07:46.461: E/AndroidRuntime(24240): at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:50)
12-31 10:07:46.461: E/AndroidRuntime(24240): at com.wataiso.labnotebook.DatabaseHelper.getInfo(DatabaseHelper.java:477)
12-31 10:07:46.461: E/AndroidRuntime(24240): at com.wataiso.labnotebook.TableauDeBord.showLinkedViewDB(TableauDeBord.java:607)
12-31 10:07:46.461: E/AndroidRuntime(24240): at com.wataiso.labnotebook.TableauDeBord.onResume(TableauDeBord.java:226)
12-31 10:07:46.461: E/AndroidRuntime(24240): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
12-31 10:07:46.461: E/AndroidRuntime(24240): at android.app.Activity.performResume(Activity.java:5310)
12-31 10:07:46.461: E/AndroidRuntime(24240): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2781)
12-31 10:07:46.461: E/AndroidRuntime(24240): ... 10 more
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!