优化线程管理,减少闲置线程数量
This commit is contained in:
@ -437,19 +437,6 @@ public class MainActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
|
||||
// 统计下载
|
||||
private void uploadData(String id, String platform) {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("game", id);
|
||||
params.put("platform", platform);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json"),
|
||||
new JSONObject(params).toString());
|
||||
RetrofitManager.getInstance(this).getApi().postDownload(body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Response<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0 && !mMainWrapperFragment.onHandleBackPressed()) {
|
||||
@ -724,7 +711,7 @@ public class MainActivity extends BaseActivity {
|
||||
public void onEventMainThread(EBNetworkState busNetworkState) {
|
||||
if (busNetworkState.isNetworkConnected()) {
|
||||
if (Config.getSettings() == null) {
|
||||
Config.getGhzsSettings();
|
||||
AppExecutor.getIoExecutor().execute(Config::getGhzsSettings);
|
||||
}
|
||||
|
||||
mPackageViewModel.checkData();
|
||||
|
||||
Reference in New Issue
Block a user