我创建了一个带有背景和进度条的加载页面,当它完成加载时,会启动主类,但加载屏幕没有显示出来。在加载过程中,只是一个黑屏,然后才是主屏幕。我将所有工作放在onResume中,也尝试了onStart,但都没有成功。
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.loadpage);
//get rid of title bar
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setRequestedOrientation(1);
}
@Override
public void onResume() {
super.onResume();
words = WordList.sharedWordList(this);
if(generatedLevels==null)
{
generatedLevels = new ArrayList<PuzzleMZLen>();
}
if(!p.isAlive())
{
p.start();
}
Intent i = new Intent(getApplicationContext(), Main.class);
startActivity(i);
}
非常感谢您的提前帮助。