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
protected TaskModelForEdit getModel(TaskIdentifier identifier) {
if (identifier != null)
return controller.fetchTaskForEdit(this, identifier);
else
return controller.createNewTaskForEdit();
if (identifier != null) {
TaskModelForEdit task = controller.fetchTaskForEdit(this, identifier);
if(task.getCursor().getCount() > 0)
return task;
}
return controller.createNewTaskForEdit();
}
/* ======================================================================

@ -287,7 +287,8 @@ public class TaskListAdapter extends ArrayAdapter<TaskModelForList> {
// expanded container
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
final TextView name = ((TextView)view.findViewById(R.id.task_name)); {

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

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

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

Loading…
Cancel
Save