This commit is contained in:
CsHeng
2017-09-13 19:12:48 +08:00
parent a32b45e067
commit 5dc97d2191
3 changed files with 6 additions and 25 deletions

View File

@ -52,7 +52,6 @@ import com.gh.gamecenter.manager.FilterManager;
import com.gh.gamecenter.manager.GameManager;
import com.gh.gamecenter.manager.PackageManager;
import com.gh.gamecenter.manager.UpdateManager;
import com.gh.gamecenter.retrofit.JSONObjectResponse;
import com.gh.gamecenter.retrofit.ObservableUtil;
import com.gh.gamecenter.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager;
@ -1015,27 +1014,4 @@ public class MainActivity extends BaseActivity {
});
}
// 提交默认头像
private void postDefaultIcon(final int i) { // TODO 是否删除
Map<String, String> params = new HashMap<>();
params.put("icon_key", "icon" + i);
RequestBody body = RequestBody.create(MediaType.parse("application/json"),
new JSONObject(params).toString());
RetrofitManager.getInstance(mContext).getApi()
.postDefaultIcon(LoginUtils.getToken(this), body)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new JSONObjectResponse() {
@Override
public void onResponse(JSONObject response) {
sp.edit().putBoolean("changeDefaultIcon", false).apply();
}
@Override
public void onFailure(HttpException e) {
}
}
);
}
}