1

I need to fetch data from the Server.

So I chosen Asysntask class to send my HTTP request .

Below is the template of my Code:

clss A{

 new B().getDataFromServer();  //This method will be called several times.
}

class B{
public String getDataFromServer(){

Task task = new Task();
task.execute();

}

class Task extends AysncTask{
   //async task stuff here
}

}

Now my question is, I am craeting Task task = new Task() object many times. The above step will cause perfomance issue.?? Please let me know if ther's any other simple or less memory consumption way to do this.

brig
  • 3,721
  • 12
  • 43
  • 61
  • seems you are looking for it http://stackoverflow.com/questions/4068984/running-multiple-asynctasks-at-the-same-time-not-possible – java seeker Mar 01 '14 at 09:32

1 Answers1

0

Asynchronous task run now sequentially from HoneyComb, If you really need to run the AsynTask parallely then use executeOnExecutor which run the task parallel and optimize the CPU very well.

N Sharma
  • 33,489
  • 95
  • 256
  • 444