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
0 answers

How to use LoadManager and AsyncTaskLoader with different activities?

I am fairly new to android development and have been searching for the solution for the past few days. I have a few activities in my app and each activities has to send request to web server(for example "login" activity send Http request "GET" ,…
0
votes
1 answer

How to stop AsyncTaskLoader from reloading

Currently building an Android app and utilizing AsyncTaskLoader. My app contains a ListView of articles that I obtain using JSON calls. It will leave and go somewhere else (in my case the browser) when the user clicks on an item, but when I press…
nono_exe
  • 23
  • 5
0
votes
0 answers

How to display an ArrayList(Json response) after clicking on a button

I'm new in Android . I started developing my app and I'm getting response from the website , and I want to display this response body"Json" as an ArrayList. I have created an AsyncTaskLoader + ArrayAdapter. when I click on the button ,I'm getting…
0
votes
1 answer

AsyncTaskLoader not refreshing the recycler view when the data is deleted using content provider

This is how the main class looks like where the list is package com.example.android.todolist; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import…
user7093660
0
votes
1 answer

Integrating Loaders and recycler view not working

I am using a loader and a OkHttp client to get data from a news API and populate the data in a recycler view. I used a progress bar to show until the the loader is finished loading the data . But all I see is the progress bar, the recycler view is…
Sriram R
  • 2,109
  • 3
  • 23
  • 40
0
votes
1 answer

savedInstanceState empty after onLoadReset but works well if onCreate is called and onLoadReset is not(like in case of device rotation)

I have a fragment where I fetch data from an API using AsyncTaskLoader and then inflate two separate RecyclerView each using custom Adapter. The problem is that when I click on the recycler view to go into the detailsActivity for that particular…
0
votes
2 answers

Incompatible types when create Loader

I have some problem with Loaders. I have Fragment, he implements LoaderManager.LoaderCallbacks. When I do onCreateLoader, occurs error Incompatible types. (Wrong Context) I code samples uses "getActivity()" or "getContext()". How to resolve error?…
Yahor Urbanovich
  • 733
  • 1
  • 9
  • 17
0
votes
0 answers

Base Activity doesnt get API response in onTaskComplete

I am currently facing problem in my project, where I am using an abstract base activity which extends ActionBarActivity and implements AsyncTaskCompleteListener. So there should be onTaskCompleteListener. There it is, but the problem is that there…
0
votes
2 answers

pull real time data in android app from server

I developed an android app which load data from server. But the app loads data from server when user press the load button. But I need to show real time data without pressing the reload button. For example; Gmail app shows new emails without…
anuradha
  • 692
  • 1
  • 9
  • 22
0
votes
1 answer

Cursor#getCount is used to ensure content window is filled?

Below is a code snippet from an Android tutorial book I was following. loadInBackground gets a cursor and then does cursor.getCount() to "ensure that the content window is filled". What does this mean? The docs on getCount just say "returns number…
Tan Wang
  • 811
  • 1
  • 6
  • 16
0
votes
1 answer

The best background processing way while using jsoup,problems with asynctask

I want to fetch some data from website and i am using jsoup for that.But there is a problem, when i use jsoup in an asynctask it work well but i am going to this process via a navigation view and when i click to an item it starts but navigation view…
0
votes
1 answer

AsyncTaskLoader not loading JSON data to RecyclerView when returning from another fragment

I'm adding new JSON item by POST from AddItem fragment and when item is added you return to ItemListFragment where I call getLoaderManager().initLoader(0, null, mLoaderCallbacks); at onStart(). But the newly added item doesn't show on RecyclerView.…
0
votes
1 answer

Is is right approach to use AsyncTaskLoader , which purpose is to clear external storage?

When application opens, splash screen is displayed and in the background I clean directory on external storage if it is exists, as soon as the directory is removed, another activity should be start. I was using AsyncTask, as ASyncTask is not…
0
votes
1 answer

Loader is not allways firing onLoadFinished callback

Im using AsyncTaskLoader to fetch data from web api but in some reason, loader is not firing always onLoadFinished callback. Here is snippt from my Fragment, how I use the loader. Im always restarting loader restartLoader(...).forceload() to update…
devha
  • 3,307
  • 4
  • 28
  • 52
0
votes
0 answers

AsyncTaskLoader with complex object in contructor can leak?

I have implemented an AsyncTaskLoader passing a complex object not parcelable instantiated in the Activity. This object is loaded too by another loader. My question: This object can leak the Activity when I rotate the device and the loader is not…
Ainun
  • 21
  • 1
  • 2