You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Navigate to DeckPicker (Menu > Switch to another deck)
2. Select a deck with cards to review
3. Answer a card and quickly mount the sd card
When you answer the card a thread is launched to update and commit the
changes asynchronously and if the connection with the DB is lost while
doing it (like mounting the sd card) an Exception is thrown and the app
crashes.
12-07 13:38:07.442: ERROR/AndroidRuntime(3133): Uncaught handler: thread
AsyncTask #1 exiting due to uncaught exception
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): java.lang.RuntimeException:
An error occured while executing doInBackground()
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
android.os.AsyncTask$3.done(AsyncTask.java:200)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
java.util.concurrent.FutureTask.run(FutureTask.java:122)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
java.lang.Thread.run(Thread.java:1058)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): Caused by:
java.lang.NullPointerException
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
com.ichi2.anki.Stats.toDB(Stats.java:207)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
com.ichi2.anki.Stats.updateStats(Stats.java:241)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
com.ichi2.anki.Stats.updateAllStats(Stats.java:218)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
com.ichi2.anki.Deck.answerCard(Deck.java:776)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
com.ichi2.anki.DeckTask.doInBackgroundAnswerCard(DeckTask.java:115)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
com.ichi2.anki.DeckTask.doInBackground(DeckTask.java:66)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
com.ichi2.anki.DeckTask.doInBackground(DeckTask.java:1)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
android.os.AsyncTask$2.call(AsyncTask.java:185)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)
12-07 13:38:07.472: ERROR/AndroidRuntime(3133): ... 4 more
What could we do about that? I think it's impossible to really finish the
commit so the options that I thought are:
- Show to the user a message informing him that the data could not be saved :(
- Use some structure or database like a backup and commit to the real deck
when the connection with the database is available again
Do you have any other idea?
Reported by edu.zasu on 2009-12-07 12:56:27
The text was updated successfully, but these errors were encountered:
I am not sure, but I think I have fixed this while fixing another bug. Ankidroid now
blocks in closeExternalStorageFiles() until the thread finishes. Hopefully, Android
will not unmount the sdcard until this has finished. Also, answering has been made
much quicker now, so this might not be such a big problem.
Could you please verify this again with a copy from my master branch on github?
Originally reported on Google Code with ID 38
Reported by
edu.zasu
on 2009-12-07 12:56:27The text was updated successfully, but these errors were encountered: