Мне нужно, чтобы asynctask (1) ждать до asynctas asynctask (1)
Я сделал этот трюк в asynctask (1) :
Код: Выделить всё
protected void onPostExecute(Integer integer) {
Log.e(" nbr key : "+Utils1.nbr_cle,"");
Log.e("*=======*","Démarrage de l'application *=======*");
do {
try {
Thread.sleep(300);
Log.e("======>", "Not Finished yet !");
} catch (InterruptedException e) {
e.printStackTrace();
}
}
while (!taskFinished);
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
Код: Выделить всё
@Override
protected void onPostExecute(Integer integer)
{
super.onPostExecute(integer);
SplashActivity.taskFinished = true;
int myBox_size = activityBox.realm.where(MyBox.class).findAll().size();
Log.e("MyBox Finished ","Size of mybox :" +myBox_size );
}
Подробнее здесь: https://stackoverflow.com/questions/354 ... asks-child