Fix crashes

pull/321/head 4.7.14
Alex Baker 9 years ago
parent 635e606975
commit e1ca0ca620

@ -27,8 +27,8 @@ android {
buildToolsVersion "22.0.1"
defaultConfig {
versionCode 369
versionName "4.7.13"
versionCode 370
versionName "4.7.14"
minSdkVersion 7
targetSdkVersion 22
}

@ -186,7 +186,7 @@ public class DeadlineControlSet extends TaskEditControlSetBase {
} else {
dueDateSpinner.setAlpha(1.0f);
if (date < newDateTime().withMillisOfDay(0).getMillis()) {
dueDateSpinner.setBackground(activity.getResources().getDrawable(R.drawable.textfield_underline_red, activity.getTheme()));
dueDateSpinner.setBackgroundResource(R.drawable.textfield_underline_red);
tv.setTextColor(activity.getResources().getColor(R.color.overdue));
} else {
dueDateSpinner.setBackgroundResource(getResource(activity, R.attr.textfield_underline));
@ -198,7 +198,7 @@ public class DeadlineControlSet extends TaskEditControlSetBase {
dueDateSpinner.setBackgroundResource(getResource(activity, R.attr.textfield_underline));
tv.setTextColor(unsetColor);
} else if (date < newDateTime().withMillisOfDay(0).getMillis()) {
dueDateSpinner.setBackground(activity.getResources().getDrawable(R.drawable.textfield_underline_red, activity.getTheme()));
dueDateSpinner.setBackgroundResource(R.drawable.textfield_underline_red);
tv.setTextColor(activity.getResources().getColor(R.color.overdue));
} else {
dueDateSpinner.setBackgroundResource(getResource(activity, R.attr.textfield_underline));
@ -247,7 +247,7 @@ public class DeadlineControlSet extends TaskEditControlSetBase {
} else {
dueTimeSpinner.setAlpha(1.0f);
if (newDateTime(date).withMillisOfDay(time).isBeforeNow()) {
dueTimeSpinner.setBackground(activity.getResources().getDrawable(R.drawable.textfield_underline_red, activity.getTheme()));
dueTimeSpinner.setBackgroundResource(R.drawable.textfield_underline_red);
tv.setTextColor(activity.getResources().getColor(R.color.overdue));
} else {
dueTimeSpinner.setBackgroundResource(getResource(activity, R.attr.textfield_underline));
@ -259,19 +259,13 @@ public class DeadlineControlSet extends TaskEditControlSetBase {
dueTimeSpinner.setBackgroundResource(getResource(activity, R.attr.textfield_underline));
tv.setTextColor(unsetColor);
} else if (newDateTime(date).withMillisOfDay(time).isBeforeNow()) {
dueTimeSpinner.setBackground(activity.getResources().getDrawable(R.drawable.textfield_underline_red, activity.getTheme()));
dueTimeSpinner.setBackgroundResource(R.drawable.textfield_underline_red);
tv.setTextColor(activity.getResources().getColor(R.color.overdue));
} else {
dueTimeSpinner.setBackgroundResource(getResource(activity, R.attr.textfield_underline));
tv.setTextColor(themeColor);
}
}
if (atLeastHoneycomb()) {
dueTimeSpinner.setAlpha(time == -1 ? 0.5f : 1.0f);
} else {
tv.setTextColor(time >= 0 ? themeColor : unsetColor);
}
return tv;
}

@ -5,11 +5,15 @@ import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.widget.Toast;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tasks.R;
import org.tasks.dialogs.DialogBuilder;
public abstract class ProgressDialogAsyncTask extends AsyncTask<Void, Void, Integer> {
private static final Logger log = LoggerFactory.getLogger(ProgressDialogAsyncTask.class);
ProgressDialog progressDialog;
private Activity activity;
private DialogBuilder dialogBuilder;
@ -28,7 +32,11 @@ public abstract class ProgressDialogAsyncTask extends AsyncTask<Void, Void, Inte
@Override
protected void onPostExecute(Integer integer) {
if (progressDialog.isShowing()) {
progressDialog.dismiss();
try {
progressDialog.dismiss();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
Toast.makeText(activity, activity.getString(getResultResource(), integer), Toast.LENGTH_LONG).show();

Loading…
Cancel
Save