其他APP 跳转到光环助手某个页面

This commit is contained in:
khy
2016-08-12 09:33:57 +08:00
parent 99cfa2080f
commit 0861208b64
2 changed files with 139 additions and 76 deletions

View File

@ -676,17 +676,23 @@ public class SplashScreenActivity extends BaseActivity {
Intent intent = new Intent(SplashScreenActivity.this,
MainActivity.class);
intent.putExtra("from", from);
if ("plugin".equals(from)) {
intent.putExtra("packageName",
getIntent().getStringExtra("packageName"));
} else if ("mipush_news".equals(from)) {
intent.putExtra("entity",
getIntent().getSerializableExtra("entity"));
} else if ("mipush_plugin".equals(from)) {
intent.putExtra("data", getIntent().getStringExtra("data"));
} else if ("plugin_install".equals(from)) {
intent.putExtra("path", getIntent().getStringExtra("path"));
Bundle bundle = getIntent().getExtras();
if(bundle != null &&bundle.getString("to") != null){
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("entity",
getIntent().getSerializableExtra("entity"));
} else if ("mipush_plugin".equals(from)) {
intent.putExtra("data", getIntent().getStringExtra("data"));
} else if ("plugin_install".equals(from)) {
intent.putExtra("path", getIntent().getStringExtra("path"));
}
}
end = System.currentTimeMillis();
@ -697,5 +703,26 @@ public class SplashScreenActivity extends BaseActivity {
finish();
}
}
private void intentControl(Bundle bundle, Intent intent) {
String to = bundle.getString("to");
if("NewsActivity".equals(to)){
intent.putExtra("newsId" , bundle.getString("newsId"));
intent.putExtra("entrance" , bundle.getString("entrance"));
}else if("DownloadManagerActivity".equals(to)){
intent.putExtra("packageName" , bundle.getString("packageName"));
}else if ("GameDetailsActivity".equals(to)){
intent.putExtra("gameId" , bundle.getString("gameId"));
intent.putExtra("entrance" , bundle.getString("entrance"));
}else if ("SubjectActivity".equals(to)){
intent.putExtra("id" , bundle.getString("id"));
intent.putExtra("name" , bundle.getString("name"));
intent.putExtra("order" , bundle.getBoolean("order"));
}else if ("ViewImageActivity".equals(to)){
intent.putExtra("urls" , bundle.getStringArrayList("urls"));
intent.putExtra("current" , bundle.getInt("current",0));
intent.putExtra("ScaleType" , bundle.getString("ScaleType"));
}
intent.putExtra("to" , to);
}
}