fixed crashes

This commit is contained in:
Mariotaku Lee 2016-07-12 09:26:23 +08:00
parent 40d79d0113
commit 943a5f8357
2 changed files with 16 additions and 13 deletions

View File

@ -28,8 +28,8 @@ android {
applicationId "org.mariotaku.twidere"
minSdkVersion 14
targetSdkVersion 24
versionCode 200
versionName "3.1.11"
versionCode 201
versionName "3.1.12"
multiDexEnabled true
buildConfigField 'boolean', 'LEAK_CANARY_ENABLED', 'Boolean.parseBoolean("false")'

View File

@ -213,6 +213,7 @@ public class UserProfileEditorFragment extends BaseSupportFragment implements On
final int backgroundColor = mBackgroundColor.getColor();
mTask = new UpdateProfileTaskInternal(this, mAccountId, mUser, name, url, location,
description, linkColor, backgroundColor);
mTask.setResultHandler(this);
TaskStarter.execute(mTask);
return true;
}
@ -522,7 +523,7 @@ public class UserProfileEditorFragment extends BaseSupportFragment implements On
}
@Override
protected void afterExecute(UserProfileEditorFragment callback, SingleResponse<ParcelableUser> result) {
protected void afterExecute(@Nullable UserProfileEditorFragment callback, SingleResponse<ParcelableUser> result) {
super.afterExecute(callback, result);
if (result.hasData()) {
final ParcelableAccount account = result.getExtras().getParcelable(EXTRA_ACCOUNT);
@ -532,6 +533,7 @@ public class UserProfileEditorFragment extends BaseSupportFragment implements On
TaskStarter.execute(task);
}
}
if (callback != null) {
callback.executeAfterFragmentResumed(new Action() {
@Override
public void execute(IBaseFragment fragment) {
@ -543,6 +545,7 @@ public class UserProfileEditorFragment extends BaseSupportFragment implements On
}
});
}
}
@Override
protected void beforeExecute() {
@ -575,7 +578,7 @@ public class UserProfileEditorFragment extends BaseSupportFragment implements On
}
@Override
protected void afterExecute(UserProfileEditorFragment callback, final SingleResponse<Boolean> result) {
protected void afterExecute(@Nullable UserProfileEditorFragment callback, final SingleResponse<Boolean> result) {
super.afterExecute(callback, result);
if (result.getData() != null && result.getData()) {
getUserInfo();