need help, got confuse with AsyncTask

后端 未结 4 1643
-上瘾入骨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:23

    In short:

    You need to put your tryLogin() code into the doInBackground() method of the AsyncTask.

    Incidentally, you should really take a look at your variable naming, the scope of your methods etc. Does tryLogin() really need to be protected? mUsername and mPassword are not member variables of the class, they are local variables.

    http://source.android.com/source/code-style.html

提交回复
热议问题