![](/img/trans.png)
[英]How do you have java create a random number within two ranges (e.g. 5-10 and 12-17)
[英]How do you create a title screen for an android app? E.g. When the app is loading like Facebook
嗨,我正在开发一个应用程序,但是在应用程序启动时却找不到如何创建标题/加载屏幕的方法? 是新活动还是新功能? 任何帮助表示赞赏,谢谢。
您需要启动画面。 谷歌上有很多关于它的话题。
它实际上称为启动屏幕,应该类似于:
class SplashScreen extends Activity{
/* in oncreate do all the function u want and after that finish this activity*/
public void oncreate(){
new BackGroundProcess.execute(arguments)// async task to load data
intent i = new Intent(SplashScreen.this,OtherActivity.class);
startActivity(i);
finish();
}
}
class BackGroundProcess extends AsyncTask<arguments>
{
public onPreExecute(){
// start your progress dialog here
}
public doInBackground(){
//loadDataHere
}
public onPostExecute(){
// stop your progress dialog here
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.