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 7056347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:51:23+00:00 2026-05-28T03:51:23+00:00

String address = 0123456789; Cursor unreadcountcursor = getContentResolver().query(Uri.parse(content://sms/inbox), new String[]{}, read = 0 and

  • 0
String address = 0123456789;

Cursor unreadcountcursor = getContentResolver().query(Uri.parse("content://sms/inbox"),
new String[]{}, "read = 0 and address='"+address+"'", null, null);

int count = unreadcountcursor.getCount();

Isn’t there a faster way of getting it? Because this code is very heavy to execute when you have to take the count for many numbers, it takes a lot of time to load. Is there another way, supposing that this code will be in a while loop. I know that using this in the adapter is faster and possible, but the problem with the adapter is that I have to scroll trough the list and return for the count to get updated and notifyDataSetChanged() doesn’t do anything for this.

What would be the best solution?

Thanks.

  • 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-05-28T03:51:24+00:00Added an answer on May 28, 2026 at 3:51 am

    I am not sure this will spare much of device time, but of yours – definitly:

     Cursor countCursor = getContentResolver().query(CONTENT_URI,
                    "count(*) AS count",
                    null,
                    null,
                    null);
    
            countCursor.moveToFirst();
            int count = countCursor.getInt(0);
    

    cited from here

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

Sidebar

Related Questions

When I query the content://sms/ content provider and pull information from the address column;
This is my MapActivity Class, it should read the address from the string, reverse
I have string: @address = 10 Madison Avenue, New York, NY - (212) 538-1884
I have this code: public static String Download(string address) { WebClient client = new
public ActionResult GetGeoLocation(string address) { var uri = string.Format( http://maps.google.com/maps/api/geocode/json?address={0}&sensor=false, HttpUtility.UrlEncode(address) ); var request
I make simple function to send SMS. public void send(String address, String packet){//address=13614951242 packet=a
I created a rails model by doing script/generate model Customer name:string address:string city:string state:string
I would like to get the address string of the current user location. Is
I am using the following method to reverse geocode a google maps latlng: [GClientGeocoder.getLocations(address:String,
public class Address { public string ZipCode {get; set;} } public class Customer {

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.