修复意见反馈提示顺序混乱问题

This commit is contained in:
kehaoyuan
2017-05-17 18:32:51 +08:00
parent 4f99477d83
commit 611068a9b0
7 changed files with 78 additions and 77 deletions

View File

@ -516,36 +516,18 @@ public class MainActivity extends BaseActivity implements OnClickListener {
.getSuggestionType()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Response<SuggestionTypeEntity>() {
.subscribe(new Response<ResponseBody>() {
@Override
public void onResponse(SuggestionTypeEntity response) {
public void onResponse(ResponseBody response) {
super.onResponse(response);
Set<String> suggestionGame = response.getGame();
Set<String> suggestionLibao = response.getLibao();
Set<String> suggestionPlugin = response.getPlugin();
Set<String> suggestionService = response.getService();
SharedPreferences.Editor edit = sp.edit();
if (suggestionGame.size() != 0) {
edit.putStringSet("suggestionGame", suggestionGame);
} else {
edit.remove("suggestionGame");
try {
String string = response.string();
SharedPreferences.Editor edit = sp.edit();
edit.putString("SuggestionType", string);
edit.apply();
} catch (IOException e) {
e.printStackTrace();
}
if (suggestionLibao.size() != 0) {
edit.putStringSet("suggestionLibao", suggestionLibao);
} else {
edit.remove("suggestionLibao");
}
if (suggestionPlugin.size() != 0) {
edit.putStringSet("suggestionPlugin", suggestionPlugin);
} else {
edit.remove("suggestionPlugin");
}
if (suggestionService.size() != 0) {
edit.putStringSet("suggestionService", suggestionService);
} else {
edit.remove("suggestionService");
}
edit.apply();
}
@Override