Fix for crashes that people have encountered

pull/14/head
Tim Su 15 years ago
parent 8168b1f352
commit a319a8967b

@ -186,10 +186,13 @@ public class TaskEdit extends TaskModificationTabbedActivity<TaskModelForEdit> {
@Override @Override
protected TaskModelForEdit getModel(TaskIdentifier identifier) { protected TaskModelForEdit getModel(TaskIdentifier identifier) {
if (identifier != null) if (identifier != null) {
return controller.fetchTaskForEdit(this, identifier); TaskModelForEdit task = controller.fetchTaskForEdit(this, identifier);
else if(task.getCursor().getCount() > 0)
return controller.createNewTaskForEdit(); return task;
}
return controller.createNewTaskForEdit();
} }
/* ====================================================================== /* ======================================================================

@ -287,7 +287,8 @@ public class TaskListAdapter extends ArrayAdapter<TaskModelForList> {
// expanded container // expanded container
final View expandedContainer = view.findViewById(R.id.expanded_layout); final View expandedContainer = view.findViewById(R.id.expanded_layout);
expandedContainer.setVisibility(isExpanded ? View.VISIBLE : View.GONE); if(expandedContainer == null)
expandedContainer.setVisibility(isExpanded ? View.VISIBLE : View.GONE);
// name // name
final TextView name = ((TextView)view.findViewById(R.id.task_name)); { final TextView name = ((TextView)view.findViewById(R.id.task_name)); {

@ -1065,6 +1065,9 @@ public class TaskListSubActivity extends SubActivity {
/** Toggle the timer */ /** Toggle the timer */
private void toggleTimer(TaskModelForList task) { private void toggleTimer(TaskModelForList task) {
if(task == null)
return;
if (task.getTimerStart() == null) { if (task.getTimerStart() == null) {
FlurryAgent.onEvent("start-timer"); FlurryAgent.onEvent("start-timer");
task.setTimerStart(new Date()); task.setTimerStart(new Date());

@ -147,8 +147,12 @@ public abstract class SynchronizationProvider {
} }
syncHandler.post(new Runnable() { syncHandler.post(new Runnable() {
public void run() { public void run() {
if(progressDialog != null) try {
progressDialog.dismiss(); if(progressDialog != null)
progressDialog.dismiss();
} catch (Exception e) {
// suppress it
}
DialogUtilities.okDialog(context, messageToDisplay, null); DialogUtilities.okDialog(context, messageToDisplay, null);
} }
}); });

@ -170,9 +170,9 @@ public class Preferences {
// united states, you are special // united states, you are special
if(Locale.US.equals(Locale.getDefault()) || if(Locale.US.equals(Locale.getDefault()) ||
Locale.CANADA.equals(Locale.getDefault())) Locale.CANADA.equals(Locale.getDefault()))
return new SimpleDateFormat("EEE MMM d yy"); return new SimpleDateFormat("EEE, MMM d yyyy");
else else
return new SimpleDateFormat("EEE d MMM yy"); return new SimpleDateFormat("EEE, d MMM yyyy");
} }
// --- notification settings // --- notification settings

Loading…
Cancel
Save