修改错误上传逻辑,修改第一次启动判断字段

This commit is contained in:
huangzhuanghua
2016-10-26 10:54:43 +08:00
parent 2954260722
commit ab9a8fd106
4 changed files with 39 additions and 32 deletions

View File

@ -10,6 +10,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.KeyEvent;
import android.view.View;
@ -71,6 +72,7 @@ public class SplashScreenActivity extends BaseActivity {
private long start;
private boolean isFirst;
private boolean isNewFirstLaunch;
private Handler handler = new Handler();
@ -85,11 +87,11 @@ public class SplashScreenActivity extends BaseActivity {
isFirst = true;
sp = getSharedPreferences(Config.PREFERENCE, Context.MODE_PRIVATE);
isNewFirstLaunch = sp.getBoolean("isNewFirstLaunchV" + PackageUtils.getVersion(getApplicationContext()), true);
from = getIntent().getStringExtra("from");
if (sp.getBoolean("isNewFirstLaunch", true)
|| sp.getInt("actionbar_height", 0) != 0) {
if (isNewFirstLaunch || sp.getInt("actionbar_height", 0) != 0) {
setTheme(R.style.AppTheme_Guide);
} else {
setTheme(R.style.AppTheme_Fullscreen);
@ -105,7 +107,7 @@ public class SplashScreenActivity extends BaseActivity {
}
}
if (sp.getBoolean("isNewFirstLaunch", true)) {
if (isNewFirstLaunch) {
setContentView(R.layout.activity_splash_intro);
ViewPager splash_viewPager = (ViewPager) findViewById(R.id.splash_viewPager);
splash_viewPager.setAdapter(new ViewPagerAdapter());
@ -167,7 +169,7 @@ public class SplashScreenActivity extends BaseActivity {
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
if (sp.getBoolean("isNewFirstLaunch", true)) {
if (isNewFirstLaunch) {
launch();
} else {
return true;
@ -236,7 +238,7 @@ public class SplashScreenActivity extends BaseActivity {
startService(new Intent(this, DownloadService.class));
// 不是第一次启动
if (!sp.getBoolean("isNewFirstLaunch", true)) {
if (!isNewFirstLaunch) {
int height = sp.getInt("actionbar_height", 0);
if (height == 0) {
final ActionBar actionBar = getActionBar();
@ -405,14 +407,16 @@ public class SplashScreenActivity extends BaseActivity {
intentControl(bundle, intent);
} else {
intent.putExtra("from", from);
if ("plugin".equals(from)) {
intent.putExtra("packageName", getIntent().getStringExtra("packageName"));
} else if ("mipush_news".equals(from)) {
intent.putExtra("newsId", getIntent().getStringExtra("newsId"));
} else if ("mipush_plugin".equals(from)) {
intent.putExtra("data", getIntent().getStringExtra("data"));
} else if ("plugin_install".equals(from)) {
intent.putExtra("path", getIntent().getStringExtra("path"));
if (!TextUtils.isEmpty(from)) {
if ("plugin".equals(from)) {
intent.putExtra("packageName", getIntent().getStringExtra("packageName"));
} else if ("mipush_news".equals(from)) {
intent.putExtra("newsId", getIntent().getStringExtra("newsId"));
} else if ("mipush_plugin".equals(from)) {
intent.putExtra("data", getIntent().getStringExtra("data"));
} else if ("plugin_install".equals(from)) {
intent.putExtra("path", getIntent().getStringExtra("path"));
}
}
}