Android : create limited instances of AsyncTask

on Friday, April 17, 2015


i am fetching user's location in a service, that implements LocationListner. and in OnlocationChanged() method, i am creating an instance of asynctask class that will upload the values to online database. The problem is that as soon as the onlocation changed method is called by Listener, a new instance of async task is created and is slows down the device. I want a method to limit the instances of asyctask to at most 5.


0 comments:

Post a Comment