1

My App needs to call multiple AsyncTask task. I am getting an error of

Android AsyncTask #2 calls detach()
Android AsyncTask #3 calls detach()
...

What does it mean ?

Also how can I have multiple AsyncTask running at the same time for API 14 ++

this is how I use my Async

   private void callAPI() {
    new AsyncTask<Void, Void, String>() {

            protected String doInBackground(Void... parameters) {



                List<NameValuePair> params = new ArrayList<NameValuePair>();
                params.add(new BasicNameValuePair("user_id",    user_id));

                return api.post("", params);


            }//end doInBackground


            protected void onPostExecute(String result) {
                Log.i(TAG + "POST() => " + result);


            }//end onPostExecute
        }.execute(); //end AsyncTask
      }

LogCat

03-11 11:46:25.811: I/System.out(20646): AsyncTask #8 calls detatch()
03-11 11:46:26.676: I/System.out(20646): AsyncTask #8 calls detatch()
03-11 11:46:28.206: I/OMXClient(20646): Using client-side OMX mux.
03-11 11:46:28.211: I/OMXCodec(20646): Attempting to allocate OMX node 'OMX.Exynos.avc.dec'
03-11 11:46:28.231: I/OMXCodec(20646): Successfully allocated OMX node 'OMX.Exynos.avc.dec'
03-11 11:46:28.236: I/OMXCodec(20646): [OMX.Exynos.avc.dec] AVC profile = 66 (Baseline), level = 40
03-11 11:46:28.236: E/Parcel(20646): nm 28
03-11 11:46:28.236: E/Parcel(20646): nm 28
03-11 11:46:28.236: E/Parcel(20646): nm 96
03-11 11:46:28.236: I/OMXCodec(20646): [OMX.Exynos.avc.dec] use default FrameRate (30)
03-11 11:46:28.236: E/Parcel(20646): nm 96
03-11 11:46:28.236: E/Parcel(20646): nm 96
03-11 11:46:28.236: I/OMXCodec(20646): [OMX.Exynos.avc.dec] video dimensions are 1724 x 720
03-11 11:46:28.276: I/OMXClient(20646): Using client-side OMX mux.
03-11 11:46:28.276: I/OMXCodec(20646): Attempting to allocate OMX node 'OMX.Exynos.avc.dec'
03-11 11:46:28.296: I/OMXCodec(20646): Successfully allocated OMX node 'OMX.Exynos.avc.dec'
03-11 11:46:28.296: I/OMXCodec(20646): [OMX.Exynos.avc.dec] AVC profile = 66 (Baseline), level = 40
Thiago
  • 12,778
  • 14
  • 93
  • 110
  • 1
    Hey Joolah, any news on this? I've recently seen more of these noisy logs with "AsyncTask calls detatch()". Funny how it misspells 'detach'. – Peter Tran Jun 22 '15 at 22:07
  • 1
    I think this log entry is specific to Samsung devices. Is that the case? – matiash Oct 19 '16 at 18:03

1 Answers1

3

You need to initialise class extending AsyncTask and use them for multiple calling to AsynTask

The detailed answer is at :

Check answer : https://stackoverflow.com/a/28978760/1994950

This will work for your requirement

Community
  • 1
  • 1
Kushal
  • 8,100
  • 9
  • 63
  • 82