Android wait AsyncTask to finish

前端 未结 4 848
忘掉有多难
忘掉有多难 2020-12-04 15:47

I have a function, AppHelper.isOnline(Context context), I call in various parts of my application to check that a session didn\'t timeout before making an HTTP

4条回答
  •  情歌与酒
    2020-12-04 16:27

    intent = new Intent(this, OrdineCreaActivity.class);
    context.startActivityForResult(intent, R.id.buttonPagamenti);
    

    Write the above lines in onPostExecute() of you AysncTask. Because if we are using AsyncTask it wont wait there until the task complete.

提交回复
热议问题