彻底删除小米推送,整理部分TODO
This commit is contained in:
@ -8,7 +8,6 @@ import android.text.TextUtils;
|
||||
import com.gh.base.BaseActivity;
|
||||
import com.gh.common.util.EntranceUtils;
|
||||
import com.gh.common.util.PlatformUtils;
|
||||
import com.gh.common.util.RunningUtils;
|
||||
|
||||
import static com.gh.common.util.EntranceUtils.ENTRANCE_BROWSER;
|
||||
import static com.gh.common.util.EntranceUtils.HOST_ARTICLE;
|
||||
@ -57,85 +56,42 @@ public class SkipActivity extends BaseActivity {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.putExtra(KEY_ENTRANCE, ENTRANCE_BROWSER);
|
||||
|
||||
if (RunningUtils.isRunning(this)
|
||||
&& MainActivity.class.getName().equals(RunningUtils.getBaseActivity(this))) {
|
||||
// 应用正在运行,前台或后台
|
||||
Bundle bundle = new Bundle();
|
||||
|
||||
if (host != null) {
|
||||
switch (host) {
|
||||
case HOST_ARTICLE:
|
||||
intent.setClass(this, NewsDetailActivity.class);
|
||||
intent.putExtra(KEY_NEWSID, id);
|
||||
break;
|
||||
case HOST_GAME:
|
||||
intent.setClass(this, GameDetailActivity.class);
|
||||
intent.putExtra(KEY_GAMEID, id);
|
||||
break;
|
||||
case HOST_COLUMN:
|
||||
intent.setClass(this, SubjectActivity.class);
|
||||
intent.putExtra(KEY_ID, id);
|
||||
intent.putExtra(KEY_NAME, getIntent().getData().getQueryParameter(KEY_NAME));
|
||||
break;
|
||||
case HOST_SUGGESTION:
|
||||
String content = String.format("【%s-%s-V%s】",
|
||||
uri.getQueryParameter(KEY_GAME_NAME),
|
||||
PlatformUtils.getInstance(this).getPlatformName(uri.getQueryParameter(KEY_PLATFORM)),
|
||||
uri.getQueryParameter(KEY_VERSION));
|
||||
intent.putExtra(KEY_CONTENT, content);
|
||||
intent.putExtra(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN);
|
||||
intent.putExtra(EntranceUtils.KEY_SUGGESTTYPE, 4);
|
||||
intent.setClass(this, SuggestionActivity.class);
|
||||
break;
|
||||
case HOST_DOWNLOAD:
|
||||
intent.setClass(this, DownloadManagerActivity.class);
|
||||
intent.putExtra(KEY_GAMEID, id);
|
||||
intent.putExtra(KEY_PACKAGENAME, getIntent().getData().getQueryParameter(KEY_PACKAGENAME));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (host != null) {
|
||||
switch (host) {
|
||||
case HOST_ARTICLE:
|
||||
bundle.putString(KEY_TO, "NewsDetailActivity");
|
||||
bundle.putString(KEY_NEWSID, id);
|
||||
break;
|
||||
case HOST_GAME:
|
||||
bundle.putString(KEY_TO, "GameDetailActivity");
|
||||
bundle.putString(KEY_GAMEID, id);
|
||||
break;
|
||||
case HOST_COLUMN:
|
||||
bundle.putString(KEY_TO, "SubjectActivity");
|
||||
bundle.putString(KEY_ID, id);
|
||||
bundle.putString(KEY_NAME, getIntent().getData().getQueryParameter(KEY_NAME));
|
||||
break;
|
||||
case HOST_SUGGESTION:
|
||||
String content = String.format("【%s-%s-V%s】",
|
||||
uri.getQueryParameter(KEY_GAME_NAME),
|
||||
PlatformUtils.getInstance(this).getPlatformName(uri.getQueryParameter(KEY_PLATFORM)),
|
||||
uri.getQueryParameter(KEY_VERSION));
|
||||
bundle.putString(KEY_TO, "SuggestionActivity");
|
||||
bundle.putString(KEY_CONTENT, content);
|
||||
bundle.putString(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN);
|
||||
bundle.putInt(EntranceUtils.KEY_SUGGESTTYPE, 4);
|
||||
break;
|
||||
case HOST_DOWNLOAD:
|
||||
bundle.putString(KEY_TO, DownloadManagerActivity.TAG);
|
||||
bundle.putString(KEY_GAMEID, id);
|
||||
bundle.putString(KEY_PACKAGENAME, getIntent().getData().getQueryParameter(KEY_PACKAGENAME));
|
||||
break;
|
||||
|
||||
} else {
|
||||
// 应用未在运行
|
||||
intent.setClass(this, SplashScreenActivity.class);
|
||||
intent.setAction(Intent.ACTION_MAIN);
|
||||
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
|
||||
if (host != null) {
|
||||
|
||||
switch (host) {
|
||||
case HOST_ARTICLE:
|
||||
intent.putExtra(KEY_NEWSID, id);
|
||||
intent.putExtra(KEY_TO, "NewsDetailActivity");
|
||||
break;
|
||||
case HOST_GAME:
|
||||
intent.putExtra(KEY_NEWSID, id);
|
||||
intent.putExtra(KEY_TO, "GameDetailActivity");
|
||||
break;
|
||||
case HOST_COLUMN:
|
||||
intent.putExtra(KEY_TO, "SubjectActivity");
|
||||
intent.putExtra(KEY_ID, id);
|
||||
intent.putExtra(KEY_NAME, getIntent().getData().getQueryParameter(KEY_NAME));
|
||||
break;
|
||||
case HOST_SUGGESTION:
|
||||
String content = String.format("【%s-%s-V%s】",
|
||||
uri.getQueryParameter(KEY_GAME_NAME),
|
||||
PlatformUtils.getInstance(this).getPlatformName(uri.getQueryParameter(KEY_PLATFORM)),
|
||||
uri.getQueryParameter(KEY_VERSION));
|
||||
intent.putExtra(KEY_CONTENT, content);
|
||||
intent.putExtra(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN);
|
||||
intent.putExtra(EntranceUtils.KEY_SUGGESTTYPE, 4);
|
||||
intent.putExtra(KEY_TO, "SuggestionActivity");
|
||||
break;
|
||||
case HOST_DOWNLOAD:
|
||||
intent.putExtra(KEY_TO, DownloadManagerActivity.TAG);
|
||||
intent.putExtra(KEY_GAMEID, id);
|
||||
intent.putExtra(KEY_PACKAGENAME, getIntent().getData().getQueryParameter(KEY_PACKAGENAME));
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
startActivity(intent);
|
||||
EntranceUtils.jumpActivity(this, bundle);
|
||||
}
|
||||
finish();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user