What to do with AsyncTask in onPause()?

后端 未结 4 2006
无人共我
无人共我 2020-12-09 13:07

I\'m using an AsyncTask in my activity. Looks like:

public class MyActivity {
    private AsyncTask mTask;

    private void doSomethingCool() {
        mTas         


        
4条回答
  •  醉话见心
    2020-12-09 13:28

    Click Here for a great thread posted to the android-developers listserv with some good information on handling screen transitions or incoming calls while running an AsyncTask.

    It's written by Mark Murphy from http://commonsware.com/

    He includes a link to one of his projects that uses a bus system for handling background threads. https://github.com/commonsguy/cwac-bus/tree

    I ended up implementing something that looks a lot like this post in my application and it is working great!

提交回复
热议问题