catching staledataexception and ignoring it. =(

pull/14/head
Tim Su 15 years ago
parent 689c24ccd0
commit a71fcc2ba9

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.timsu.astrid"
android:versionCode="88"
android:versionName="2.4.3">
android:versionCode="89"
android:versionName="2.4.4">
<meta-data android:name="com.a0soft.gphone.aTrackDog.webURL"
android:value="http://www.weloveastrid.com" />

@ -35,6 +35,7 @@ import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.StaleDataException;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
@ -173,7 +174,24 @@ public class TaskListSubActivity extends SubActivity {
@Override
public void run() {
loadTaskListSort();
fillData();
try {
fillData();
} catch (StaleDataException e) {
// happens when you rotate the screen whiel the thread is
// still running. i don't think it's avoidable?
} catch (final Exception e) {
Log.e("astrid", "Error loading task list", e);
handler.post(new Runnable() {
public void run() {
DialogUtilities.okDialog(getParent(),
"Error loading task list, FYI. If you " +
"continue to have problems, please let " +
"me know!\n\n" + e.getClass().getSimpleName() +
": " + e.getMessage(),
null);
}
});
}
// open up reminder box
if(variables != null && variables.containsKey(NOTIF_FLAGS_TOKEN) &&
@ -408,7 +426,7 @@ public class TaskListSubActivity extends SubActivity {
}
/** Fill in the Task List with our tasks */
private synchronized void fillData() {
private void fillData() {
// get a cursor to the task list
Cursor tasksCursor;
if(filterTag != null) {

Loading…
Cancel
Save