Only show dialog when really out of memory.

pull/14/head
Tim Su 17 years ago
parent cf290c89f2
commit 57fa2678c0

@ -507,16 +507,19 @@ public class TaskListSubActivity extends SubActivity {
// still running. i don't think it's avoidable? // still running. i don't think it's avoidable?
Log.w("astrid", "StaleDataException", e); Log.w("astrid", "StaleDataException", e);
return; return;
} catch (IllegalStateException e) { } catch (final IllegalStateException e) {
// happens when you run out of memory usually // happens when you run out of memory usually
Log.e("astrid", "Error loading task list", e); Log.e("astrid", "Error loading task list", e);
handler.post(new Runnable() { handler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
if(!e.getMessage().contains("Couldn't init cursor window"))
return;
DialogUtilities.okDialog(getParent(), "Ran out of memory! " + DialogUtilities.okDialog(getParent(), "Ran out of memory! " +
"Try restarting Astrid...", null); "Try restarting Astrid...", null);
} }
}); });
return;
} catch (final Exception e) { } catch (final Exception e) {
Log.e("astrid", "Error loading task list", e); Log.e("astrid", "Error loading task list", e);
return; return;

Loading…
Cancel
Save