Questions tagged [asynctaskloader]

AsyncTaskLoader is an Android Loader that uses an AsyncTask to do the loading of data in a background thread.

The AsyncTaskLoader, like other types of Android Loaders, is a class that can be used to avoid having to load data on the main UI thread(loading which may block the UI thread and the app itself). The AsyncTaskLoader was introduced in the Android SDK starting with API level 11(Honeycomb) but is available in older versions through the Android compatibility package. More information about the AsyncTaskLoader along with examples of using one can be found in the documentation for the class.

199 questions
0
votes
1 answer

What is a scenerio in which when a Loader is started and there is already loaded data, which is not yet delivered to the client?

The following pseudocode implementation of onStartLoading of a custom Loader implementation is taken from this blog post. You can see that according to this method, when a loader enters a started state, i.e. when onStartLoading is called, we check…
Solace
  • 8,612
  • 22
  • 95
  • 183
0
votes
1 answer

What happens when I call restartLoader for an AsyncTaskLoader

Per the documentation, when I call restartLoader on the LoaderManager, the Bundle is delivered to my loader. Will someone please show how I might read that Bundle on the side of the loader? I hear mention of a constructor, but I am not seeing it…
learner
  • 11,490
  • 26
  • 97
  • 169
0
votes
0 answers

Parsing Large Json Strings causing OOM error

I have a news app that gets its content via JSON and at times it parses very large strings. I have an object that holds all the article's data which is then saved to a database. However, at times, I get an out of memory exception with the object…
Alex Kombo
  • 3,256
  • 8
  • 34
  • 67
0
votes
2 answers

AsyncTaskLoader is reset when device is rotated while the app is stopped

I have an AsyncTaskLoader that is being reset in a very specific case, and was hoping someone may be able to tell me why. In my activity, I am calling getSupportLoaderManager().initLoader(0, null, this) in the onCreate() method. Everything runs as…
abe
  • 1,549
  • 1
  • 11
  • 9
0
votes
1 answer

How to call a custom asyncloader from a fragment class

I am trying to use AsyncTaskLoader to load data from a server and then I will put it in a list view later on. I followed this tutorial on YouTube. However, when I try to call the loader from another class which extends fragment, the loader won't…
0
votes
0 answers

load childview data from server in ExpandableListView android

I am using ExpandableListview to load the dynamic data from server. Each Group Header has different Child Layout. On click on Group Header the Child view loads data from server. I am display the images retrieved from server , but it doesn't works as…
karthik kolanji
  • 2,044
  • 5
  • 20
  • 56
0
votes
1 answer

Showing fragment after activity fetches data

I'm fetching data in my activity that is needed by several fragments. After the data is returned, I create the fragments. I was doing this via an AsyncTask, but it led to occasional crashes if the data returned after a screen rotation or the app…
Dennis
  • 1,697
  • 2
  • 12
  • 15
0
votes
0 answers

How to call an getLoaderManager() from a class which is not an activity?

I have a fagment with a Listview which have an ImageView and a Textview inside. So when the fragment creates, I call an AsyncTaskLoader for populating it. In the onLoadFinished method I set the adaptor for the list. The problem is that I cant access…
0
votes
0 answers

Notifying multiple cursor loaders in one go

I have an app with three activities A, B, C each showing list view from a DB using asynctaskloader. I maintain the reference of the loader for the latest activity in a broadcast receiver. When there is a data change I call onContentChanged on the…
subbu
  • 1
0
votes
1 answer

Android HTML parsing with multithreading

I am developing app which requires html parsing. So, I'm currently using jsoup in AsyncTaskLoader like this (example): @Override public Boolean loadInBackground() { try { Connection.Response response =…
0
votes
1 answer

AsyncTaskLoader doesn't call onLoadFinished

I have a problem with AsyncTaskLoader. When app is starting, it works fine. Then I call onRefreshStarted, and again all is good. But if change orientation, AsyncTaskLoader start processing loadInBackground, but onLoadFinished is never called. What…
Remie
  • 117
  • 1
  • 11
0
votes
0 answers

How to test/mock AsyncTaskLoader with robotium and junit?

I use Robotium library and base JUnit framework for my test project. How can I test/mock AsyncTaskLoader? My AsyncTaskLoader initialize in onCreate method and when I call getActivity in my test it initialize and get data from web server or database.…
Viacheslav
  • 521
  • 10
  • 21
0
votes
0 answers

To fetch data from webservices, Shall we use AsyncTaskLoader or just AsyncTask?

can we replace asynctask with asynctaskloader?is there a way to use asynctaskloader which receive int parameter and return string parameter.I am talking about loadinBackground method.In asynctask loadinbackground can take parameter while in…
decoder
  • 886
  • 22
  • 46
0
votes
0 answers

Getting data from server using asynctaskloader

here is my code for getting data from server. public class POSDataCloud { private static String SOAP_ACTION1 = "http://tempuri.org/GetDescription"; private static String NAMESPACE = "http://tempuri.org/"; private static String METHOD_NAME1 =…
decoder
  • 886
  • 22
  • 46
0
votes
1 answer

Using Update Throttle in AsyncTaskLoader in Android

I am planning to use AsyncTaskLoader for my upcoming project. I have learned about Loader Callbacks, Loader Manager and AsyncTaskLoader. I have also learned how to implement the asynctaskloader to perform network operation. But, I also want to show…
Prativa
  • 364
  • 6
  • 25