今まで私はそれを使用していTimer
ましたjavax.swing.timer
- 私がしなければならなかったのは、速度を選択し、タイマーに毎回実行させたいことを実行する特定の名前のメソッドを用意することだけでした.
最近、Android アプリケーションのプログラミングを開始しましたが、いくつかの問題に直面しています...
- 使用またはインポートできません
javax.swing.timer
- 使ってみ
java.util.timer
たけど仕組みが分からなかった
タイマーが欲しいのは、ロゴを 3 秒間表示してからメイン メニューに進むためだけです。もっと簡単な解決策があるとしても、タイマーの使い方を知りたいです。
スレッドを使用してみるように言われた人のために-これが私のコードです-最初の画面をまったく描画せず、3秒間空白のままで、次のコード行に移動します...
public class logo extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
setContentView(R.layout.logoview);
Thread.sleep(3000);
}
catch (InterruptedException e){
e.printStackTrace();
}
setContentView(R.layout.main);
}
public void startup (View view){
Intent intent0 = new Intent (this,ExpiramantingActivity.class);
startActivity(intent0);}
}
}