Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8547247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:13:32+00:00 2026-06-11T13:13:32+00:00

I have an application with database and content provider. In order to display some

  • 0

I have an application with database and content provider. In order to display some data from the database in ListView‘s, I useLoaderManager.
It’s simple and works perfectly well in most of case.

But, when to many change notifications from the content provider arrives, the UI is totally overloaded. It happens when there are many inserts, about 15 per seconds, on the uri observed by the cursor. I think even if the cursor load is in background, the large amount of bindView() calls is enough to overload the UI.

So I would like, in some case as above, limit the number of loads (and so onLoadFinished() calls) to something like one per seconds.

  • Is there a way to achieve that with LoaderManager ? I tried to play with startLoading() and stopLoading but without success, and anyway it’s not recommended.

  • Or maybe I have to manage a Loader by myself, but I will be surprised if this situation is not common.

Thanks for your advice.

EDIT

I actually missed a method… setUpdateThrottle(long delayMS) do exactly what I want.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:13:33+00:00Added an answer on June 11, 2026 at 1:13 pm

    You can override applyBatch(…) in your content provider and do something like this:

    @Override
    public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations)
            throws OperationApplicationException {
        final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
        db.beginTransaction();
        try {
            final int numOperations = operations.size();
            final ContentProviderResult[] results = new ContentProviderResult[numOperations];
            for (int i = 0; i < numOperations; i++) {
                results[i] = operations.get(i).apply(this, results, i);
            }
            db.setTransactionSuccessful();
            return results;
        } finally {
            db.endTransaction();
        }
    }
    

    You can use this to batch your inserts into one transaction so notification only happens once.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I have a content provider which uses a database for the
i have inherited a database application from someone else and there are a few
I'm working on an application which accesses data from an Oracle 11g database. I'm
I have a database contact application.And i want to display my contact details in
I'm developing a content provider which stores its data in an SQLite database. During
I have an application using Spring with Hibernate on a MySQL database. For some
I have database application, I want to allow the user to restore the deleted
I have a database application in which a group is modeled like this: TABLE
I have developed an database application with Delphi XE2 using an Access DB, now
We have an application that has a database full of polygons (currently stored as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.