need help, got confuse with AsyncTask

后端 未结 4 1637
-上瘾入骨i
-上瘾入骨i 2021-01-29 07:44

I\'m new in android and i need to make AsyncTask, so my application can work on ICS. But after I read tutorials i still got confuse. Anyone, please help me to fix my code, i don

4条回答
  •  清酒与你
    2021-01-29 08:21

    use like that

    class LoginTask extends AsyncTask {
            private ProgressDialog progressDialog;
    
    
            @Override
            protected void onPreExecute()
            {
            progressDialog.show();
            }
            @Override
            protected Integer doInBackground(String... arg0)
            {
            // do all login request here only 
          }
       @Override
            protected String onPostExecute(String arg0)
            {
             progressDialog.dismiss();
    
            // get the response here and show where you want
          }
    

提交回复
热议问题