プログラムを実行した後、Logcatはいくつかのエラーを表示します(画像)。しかし、その後、プログラムは問題なく実行および動作します。問題がどこにあるのか理解できません。
プログラムの実行後、スクリーンショットが5秒間表示され、その後、メニュー(アクティビティ名はScroll_View)が表示されます。これで、LogCatにエラーが表示されます。ただし、各ボタンをクリックすると、クラスなどがなくても問題なく動作します。
大切ですか?
これはスレッドのコードです:
protected boolean _active = true;
protected int _splashTime = 5000;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
// thread for displaying the SplashScreen
Thread splashTread = new Thread() {
@Override
public void run() {
try {
int waited = 0;
while(_active && (waited < _splashTime)) {
sleep(100);
if(_active) {
waited += 100;
}
}
} catch(InterruptedException e) {
// do nothing
} finally {
finish();
startActivity(new Intent("mobilesoft.asia.malaysia_directory.SplashScreen.Scroll_View"));
stop();
}
}
};
splashTread.start();
}