Always check whether context has been destroyed.

This commit is contained in:
akwizgran
2016-09-29 14:52:00 +01:00
parent f1730aa7d9
commit cb983f02c2
49 changed files with 310 additions and 340 deletions

View File

@@ -44,7 +44,7 @@ public class WriteBlogPostActivity extends BriarActivity
Logger.getLogger(WriteBlogPostActivity.class.getName());
@Inject
protected AndroidNotificationManager notificationManager;
AndroidNotificationManager notificationManager;
private TextInputView input;
private ProgressBar progressBar;
@@ -52,7 +52,7 @@ public class WriteBlogPostActivity extends BriarActivity
// Fields that are accessed from background threads must be volatile
private volatile GroupId groupId;
@Inject
protected volatile IdentityManager identityManager;
volatile IdentityManager identityManager;
@Inject
volatile BlogPostFactory blogPostFactory;
@Inject
@@ -168,7 +168,7 @@ public class WriteBlogPostActivity extends BriarActivity
}
private void postPublished() {
runOnUiThread(new Runnable() {
runOnUiThreadUnlessDestroyed(new Runnable() {
@Override
public void run() {
setResult(RESULT_OK);
@@ -178,7 +178,7 @@ public class WriteBlogPostActivity extends BriarActivity
}
private void postFailedToPublish() {
runOnUiThread(new Runnable() {
runOnUiThreadUnlessDestroyed(new Runnable() {
@Override
public void run() {
// hide progress bar, show publish button