解决final int position导致的bug
This commit is contained in:
@ -184,46 +184,50 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
if (hasFocus && isFirst) {
|
||||
|
||||
// 第一次启动,把package.txt文件内容加载进数据库
|
||||
if (!sp.getBoolean("isLoadFilter", false)) {
|
||||
try {
|
||||
List<FilterInfo> list = new ArrayList<>();
|
||||
BufferedReader reader = new BufferedReader(
|
||||
new InputStreamReader(getAssets().open(
|
||||
"package.txt")));
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
list.add(new FilterInfo(line));
|
||||
}
|
||||
reader.close();
|
||||
FilterManager filterManager = new FilterManager(
|
||||
getApplicationContext());
|
||||
filterManager.addAllFilter(list);
|
||||
sp.edit().putBoolean("isLoadFilter", true).apply();
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
isFirst = false;
|
||||
|
||||
checkUpdateFile();
|
||||
try {
|
||||
// 第一次启动,把package.txt文件内容加载进数据库
|
||||
if (!sp.getBoolean("isLoadFilter", false)) {
|
||||
try {
|
||||
List<FilterInfo> list = new ArrayList<>();
|
||||
BufferedReader reader = new BufferedReader(
|
||||
new InputStreamReader(getAssets().open(
|
||||
"package.txt")));
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
list.add(new FilterInfo(line));
|
||||
}
|
||||
reader.close();
|
||||
FilterManager filterManager = new FilterManager(
|
||||
getApplicationContext());
|
||||
filterManager.addAllFilter(list);
|
||||
sp.edit().putBoolean("isLoadFilter", true).apply();
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
concernManager = new ConcernManager(getApplicationContext());
|
||||
checkUpdateFile();
|
||||
|
||||
/*
|
||||
* 更新过滤表,获取自动刷新的cd,获取版本对应表
|
||||
*/
|
||||
String time = sp.getString("filter_time", null);
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd",
|
||||
Locale.getDefault());
|
||||
String today = format.format(new Date());
|
||||
if (!today.equals(time)) {
|
||||
FilterManager manager = new FilterManager(
|
||||
getApplicationContext());
|
||||
manager.getFilterFromServer(today);
|
||||
getPlatform();
|
||||
concernManager = new ConcernManager(getApplicationContext());
|
||||
|
||||
/*
|
||||
* 更新过滤表,获取自动刷新的cd,获取版本对应表
|
||||
*/
|
||||
String time = sp.getString("filter_time", null);
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd",
|
||||
Locale.getDefault());
|
||||
String today = format.format(new Date());
|
||||
if (!today.equals(time)) {
|
||||
FilterManager manager = new FilterManager(
|
||||
getApplicationContext());
|
||||
manager.getFilterFromServer(today);
|
||||
getPlatform();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
toast("抛出异常");
|
||||
}
|
||||
|
||||
// 获取下载按钮状态、开启or关闭
|
||||
@ -598,10 +602,12 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
}
|
||||
entity.setTime(System.currentTimeMillis());
|
||||
entity.setPackageNames(packageNames);
|
||||
//默认安装即为关注
|
||||
// if (!concernManager.isConcern(entity.getId())) {
|
||||
// concernManager.addByEntity(gameEntity);
|
||||
// }
|
||||
if (sp.getBoolean("isNewsFirstLaunch", true)) {
|
||||
//默认安装即为关注
|
||||
if (!concernManager.isConcern(entity.getId())) {
|
||||
concernManager.addByEntity(gameEntity);
|
||||
}
|
||||
}
|
||||
concernManager.updateByConcern(entity);
|
||||
}
|
||||
if (cCount == count) {
|
||||
|
||||
Reference in New Issue
Block a user