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
1
vote
1 answer

AsyncTaskLoader vs AsyncTask for loading single entity in Edit single entity activity?

I am studying Android. I am creating an Activity for editing single entity that loaded from local SQLite. For List of entities activity, I used AsyncTaskLoader to load list of entities. For Editing single entity activity, I don't know I should use…
LHA
  • 9,398
  • 8
  • 46
  • 85
1
vote
0 answers

Item disappear in an endless ListView

I'm using an AsyncTaskLoader to load paginated data into an ArrayAdapter, but when I rotate the device, all of the previously fetched data will be cleared and the top of the list will now start at the last page that I fetched. private int…
1
vote
1 answer

Android - Putting Multiple ASyncTaskLoader classes as InnerClasses in a "manager" Class

Good Afternoon, I am developing an Android application that has ArrayLists of CustomObjects. These objects are generated at run-time and their properties are set from SQLite data. Since I am using SQlite i will be requiring the use of some sort of…
Nick H
  • 8,897
  • 9
  • 41
  • 64
1
vote
1 answer

Does AsyncTaskLoader really inherit from AsyncTaskLoader?

If you highlight a class in Drodio (Android Studio) and mash Ctrl+N, it will show you the inheritance hierarchy for that class, like so for AsyncTask: This seems to indicate that AsyncTaskLoader inherits from AsyncTaskLoader? Is that so? If so, was…
1
vote
1 answer

Refreshing query of AsyncTaskLoader with OnQueryTextListener

I have a custom AsyncTaskLoader that performs a search based on some query text entered into an ActionBar search: class SearchLoader extends AsyncTaskLoader> { private static final String TAG = SearchLoader.class.getName(); …
cweston
  • 11,297
  • 19
  • 82
  • 107
1
vote
1 answer

Support library's AsyncTaskLoad does not support being cancelled?

I'm using the v13 support library and all the functions required to support cancellation such as isLoadInBackgroundCanceled and cancelLoadInBackground are completely missing.
1
vote
0 answers

android Google Place API nearby bus routes

I'm working on a android app which need to show nearby bus routes, I tried out the Google Place API and works. But it seems take too many time to load, what I did was: 1- create an asyncTaskLoader to request the following URI and get all the…
user3143433
  • 157
  • 1
  • 9
1
vote
0 answers

Repeating Listview results with ListFragment Loader AsyncTaskLoader JSON

In my Listfragment I can load my JSON results from online server (1,2,3,4), but when I press home button and comeback to my App... now my Listview have a duplicate list (1,2,3,4,1,2,3,4), and sometimes this happen when rotate the screen. I read a…
1
vote
0 answers

Trouble upgrading my RSS feed reader app, from AsycTask to AsyncTaskLoader behavior

Hello I implemented a simple RSS Feed reader using an AsyncTask, and It works perfectly. I am trying upgrade my little APP to work with an ASYNCTASKLOADER, to learn how to use Loaders. Notice the two lines of code on the: public void…
Josh
  • 6,251
  • 2
  • 46
  • 73
1
vote
2 answers

Async Task Loader, Google Cloud Messaging , Sync Adapter not connected properly, Array Adapter

I am working on an application that requires data to be displayed on a listview. The data to be displayed on the listview needs to be updated frequently so i created a sync-adapter which will be triggered my a broadcast message from gcm. When this…
1
vote
1 answer

Couldn't restart android AsyncTaskLoader

Simple code which init Loader in onCreate() and restart Loader when button pressed. Regarding android documentation getLoaderManager().restartLoader() should start a new loader or restarts an existing Loader in this manager. But each time when I…
p37td8
  • 1,287
  • 2
  • 9
  • 20
1
vote
1 answer

Ways of making async service calls in Android? and when to use which?

If I want to make a request from an Android device to a remote service, I can use AsyncTask, AsyncTaskLoader, Intent, etc to make the a request apart from the UI thread. It seems there are a lot of options, but I am confused how to choose among…
Grace Huang
  • 5,355
  • 5
  • 30
  • 52
1
vote
3 answers

An asyncTask launched from an onPostExecute of another AsyncTask does not execute properly in API 10

SETUP: I have a singleton application class that has a method named fetchUpdates(). This method is called by an UpdaterService (an IntentService) class. fetchUpdates() method simply calls DownloadDataAsyncTask which then calls UpdateDbAsyncTask…
fahmy
  • 3,543
  • 31
  • 47
1
vote
1 answer

AsyncTaskLoader - onLoadFinished() is not called

I have an AsyncTaskLoader: public class FakePdfLoader extends AsyncTaskLoader That I start with: getSupportLoaderManager().initLoader(0, args, this); from an activity: MyActivity implements LoaderManager.LoaderCallbacks But my…
fweigl
  • 21,278
  • 20
  • 114
  • 205
1
vote
4 answers

AsyncTask returning null

I'm using jsoup to parse a html code, I'm using obviously an AsyncTask but it's returning null (javanullpointerexception). private class LoadDocument extends AsyncTask { ProgressDialog mProgressDialog; …
androniennn
  • 3,117
  • 11
  • 50
  • 107