我的活动 Splash 中有此代码。但是,问题是当我启动我的应用程序时它没有出现。这里的“错误步骤”可能是什么,我该怎么做才能对其进行排序?
public class Splash extends Activity {
Handler handler;
private long timeDelay = 2500;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
final Intent i = new Intent(this, Quotes.class);
handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
startActivity(i);
finish();
}
}, timeDelay);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.splash, menu);
return true;
}
}