去掉viewMap,在实体中添加views解决
修复部分问题
This commit is contained in:
@ -460,20 +460,23 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
}
|
||||
setContentView(contentView);
|
||||
|
||||
sp = getSharedPreferences(Config.PREFERENCE, Context.MODE_PRIVATE);
|
||||
isNewFirstLaunch = sp.getBoolean("isNewFirstLaunchV" + PackageUtils.getVersion(getApplicationContext()), true);
|
||||
|
||||
initViews();
|
||||
if (savedInstanceState != null) {
|
||||
currentTab = savedInstanceState.getInt("currentTab");
|
||||
} else if (isNewFirstLaunch) {
|
||||
currentTab = 1;
|
||||
} else {
|
||||
currentTab = 0;
|
||||
}
|
||||
setTabSelection(currentTab);
|
||||
|
||||
sp = getSharedPreferences(Config.PREFERENCE, Context.MODE_PRIVATE);
|
||||
concernManager = new ConcernManager(getApplicationContext());
|
||||
|
||||
getSearchHints();
|
||||
|
||||
isNewFirstLaunch = sp.getBoolean("isNewFirstLaunchV" + PackageUtils.getVersion(getApplicationContext()), true);
|
||||
if (!isNewFirstLaunch && sp.getBoolean("autoupdate", true)) {
|
||||
// 检查助手更新
|
||||
checkUpdate();
|
||||
@ -724,13 +727,6 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
concernInfo.setPackageNames(packageNames);
|
||||
concernManager.updateByConcern(concernInfo);
|
||||
}
|
||||
//无需默认关注
|
||||
// if (isNewFirstLaunch) {
|
||||
// //默认安装即为关注
|
||||
// if (!concernManager.isConcern(gameEntity.getId())) {
|
||||
// concernManager.addByEntity(gameEntity);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
addConcernCount();
|
||||
if (cCount == size) {
|
||||
@ -1039,7 +1035,11 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
Intent toIntent = new Intent(MainActivity.this, clazz);
|
||||
if ("NewsActivity".equals(to) || "NewsDetailActivity".equals(to)) {
|
||||
toIntent.putExtra("newsId", getIntent().getExtras().getString("newsId"));
|
||||
toIntent.putExtra("entrance", "(插件跳转)");
|
||||
String entrance = getIntent().getExtras().getString("entrance");
|
||||
if (TextUtils.isEmpty(entrance) || !entrance.startsWith("(") || !entrance.endsWith(")")) {
|
||||
entrance = "(插件跳转)";
|
||||
}
|
||||
toIntent.putExtra("entrance", entrance);
|
||||
} else if("DownloadManagerActivity".equals(to)) {
|
||||
String packageName = getIntent().getExtras().getString("packageName");
|
||||
if (packageName != null) {
|
||||
@ -1048,7 +1048,11 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
}
|
||||
} else if ("GameDetailsActivity".equals(to) || "GameDetailActivity".equals(to)) {
|
||||
toIntent.putExtra("gameId", getIntent().getExtras().getString("gameId"));
|
||||
toIntent.putExtra("entrance", "(插件跳转)");
|
||||
String entrance = getIntent().getExtras().getString("entrance");
|
||||
if (TextUtils.isEmpty(entrance) || !entrance.startsWith("(") || !entrance.endsWith(")")) {
|
||||
entrance = "(插件跳转)";
|
||||
}
|
||||
toIntent.putExtra("entrance", entrance);
|
||||
} else if ("SubjectActivity".equals(to)) {
|
||||
toIntent.putExtra("id", getIntent().getExtras().getString("id"));
|
||||
toIntent.putExtra("name", getIntent().getExtras().getString("name"));
|
||||
@ -1232,7 +1236,6 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
private ProgressBar app_pb_progress;
|
||||
private TextView app_tv_speed;
|
||||
private TextView app_tv_percent;
|
||||
private TextView app_tv_cancel;
|
||||
|
||||
private void showDownloadDialog(String md5) {
|
||||
downloadDialog = new Dialog(this);
|
||||
@ -1243,8 +1246,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
app_tv_speed = (TextView) view.findViewById(R.id.app_tv_speed);
|
||||
app_tv_percent = (TextView) view.findViewById(R.id.app_tv_percent);
|
||||
|
||||
app_tv_cancel = (TextView) view.findViewById(R.id.app_tv_cancel);
|
||||
app_tv_cancel.setOnClickListener(new OnClickListener() {
|
||||
view.findViewById(R.id.app_tv_cancel).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
DownloadManager.getInstance(getApplicationContext()).cancel(appEntity.getUrl());
|
||||
@ -1303,8 +1305,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String version = PackageUtils.getVersion(this);
|
||||
String user = DeviceUtils.getDeviceID(this);
|
||||
String channel = (String) PackageUtils.getMetaData(this,
|
||||
getPackageName(), "TD_CHANNEL_ID");
|
||||
String channel = (String) PackageUtils.getMetaData(this, getPackageName(), "TD_CHANNEL_ID");
|
||||
map.put("step", step);
|
||||
map.put("version", version);
|
||||
map.put("user", user);
|
||||
|
||||
Reference in New Issue
Block a user