[英]android start activity and keep running previous
I would like to call splashScreen activity while current activity is been executed. 我想在执行当前活动时调用splashScreen活动。 Once current activity finishes its load, finish splashScreen activity. 当前活动完成其加载后,请完成splashScreen活动。 How can I call one activity and keep executing current activity? 如何调用一个活动并继续执行当前活动? Thank you. 谢谢。
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(TabBarActivity.this, splashScreen.class);
startActivity(intent);
setContentView(R.layout.main);
cicle();
}
Have a ProgressBar load in your SplashScreen activity via an AsyncTask. 通过AsyncTask在您的SplashScreen活动中加载一个ProgressBar。 Keep updating the progressbar in that activity and once the loading is fully completed, you can start a new activity in maybe..postExecute() method. 继续更新该活动中的进度栏,一旦加载完全完成,您就可以在也许..postExecute()方法中启动一个新活动。
You can refer to this: Progressbar in Splashscreen android 您可以参考以下内容: Splashscreen android中的Progressbar
I'd suggest this: 我建议这样做:
do the "loading" in splash activity instead, whenever the loading ends, launch the next activity. 而是在启动活动中执行“加载”,只要加载结束,就启动下一个活动。 There is no need for something that complex 不需要复杂的东西
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.