Skip to main content
removed fluff
Source Link
CubeJockey
  • 2.2k
  • 8
  • 27
  • 31

In my android project I use many AsynTask in onone activity. I need the code thatto stop one AsynTask when I start other AsynTask. I'm

I'm using myAsynTask.cancel(true); in my android project. But it does stop the AsynTask. I tried many time but sill don't work.

Please help me.

In my android project I use many AsynTask in on activity. I need the code that stop AsynTask when I start other AsynTask. I'm using myAsynTask.cancel(true); in my android project. But it does stop the AsynTask. I tried many time but sill don't work.

Please help me.

In my android project I use many AsynTask in one activity. I need to stop one AsynTask when I start other.

I'm using myAsynTask.cancel(true); in my android project. But it does stop the AsynTask.

inIn my android project iI use many asynTaskAsynTask in on activity. iI need the code that stop asynTaskAsynTask when iI start other asynTask AsynTask. i was use myAsynTask.cancel(true);I'm using myAsynTask.cancel(true); in my androidandroid project. butBut it does stop the asynTaskAsynTask.i try I tried many time but sill don't work.

plzPlease help me.

in my android project i use many asynTask in on activity. i need the code that stop asynTask when i start other asynTask . i was use myAsynTask.cancel(true); in my android project. but it does stop the asynTask.i try many time but sill don't work.

plz help me.

In my android project I use many AsynTask in on activity. I need the code that stop AsynTask when I start other AsynTask. I'm using myAsynTask.cancel(true); in my android project. But it does stop the AsynTask. I tried many time but sill don't work.

Please help me.

Source Link

how to stop asyncTask android

in my android project i use many asynTask in on activity. i need the code that stop asynTask when i start other asynTask . i was use myAsynTask.cancel(true); in my android project. but it does stop the asynTask.i try many time but sill don't work.

protected String doInBackground(String... args) {

        HashMap<String, String> params = new HashMap<>();
        params.put("id", args[0]);

        Log.d("get value: ", params.toString());

        JSONObject json = jParser.makeHttpRequest(url_comment, "GET", params);

        Log.d("All matches: ", json.toString());
        
        if(isCancelled()) {
            finish();
        }
        else {

            try {

                int success = json.getInt(TAG_SUCCESS);
                if (success == 1) {

                    JSONmatches = json.getJSONArray(TAG_vedio);

                    for (int i = 0; i < JSONmatches.length(); i++) {
                        JSONObject c = JSONmatches.getJSONObject(i);

                        String title = c.getString(TAG_title);
                        String url = c.getString(TAG_url);

                        HashMap<String, String> map = new HashMap<String, String>();

                        map.put(TAG_title, title);
                        map.put(TAG_url, url);

                        arrayList22.add(map);
                    }
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

plz help me.

lang-java