スプラッシュ スクリーンが彼のタスクを終了するのを待ってから、アクティビティを続行したいと考えています。私のエラーは、スプラッシュ画面を待つ時間が長すぎるためだと思います。私のスプラッシュ画面は、サーバーから文字列を取得するためのものであり、必要なものがすべて揃っています。スプラッシュ スクリーンを作成し、完了するのを待つ必要がある最初のクラスは次のとおりです。更新:
Thread splashTread = new Thread() {
@Override
public void run() {
try {
splash splash=(tools.splash) new splash(first.this).execute();
int waited = 0;
while(splash.running && (waited< getResources().getInteger(R.integer.splashTimeOut)))
{
sleep(100);
if(splash.running) {
waited += 100;
}
// nextActivity=splash.newActivity;
}
} catch(InterruptedException e) {
// do nothing
} finally {
finish();
}
}
};
splashTread.start();
スプラッシュスクリーンは問題ありませんが、
public class splash extends AsyncTask<String, Void, String>
新しいアクティビティを作成してからスレッドを実行するため、間違っています....