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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:11:18+00:00 2026-05-24T11:11:18+00:00

I’m a bit of a first-timer to Android, but as far as I know,

  • 0

I’m a bit of a first-timer to Android, but as far as I know, if I want to bind my database to a list view with a custom row, I’ll need to override the CursorAdapter. However, I can’t start working on it because of a feature I wish to implement on my list view: not only do I want to present my list view arranged according to the ascending value of dates, I also want to have two separate sections in my list view that are both sorted according to dates but using the same cursor (if that’s even possible).

A simplified version of my schema could go like this:
_ID, NAME, DATE, TRUTH_VALUE

My default view is to have the resulting cursor’s rows sorted by date, but I also want to “filter” or make sections out of the cursor that are separated according to the “TRUTH_VALUE”, meaning I could have section 1 in my list contain items with an arbitrary value of 0 in “TRUTH_VALUE” that are sorted according to date, and have section 2 contain items whose TRUTH_VALUE columns are an arbitrary 1 that are sorted according to date as well.

I can’t seem to find any sort of adapter, or whatever, that could either accept two cursors (that are then made into a single filtered ListView) nor am I considering putting some extra parameters in my custom adapter’s constructor (eg, in instantiating my adapter, I include a value in the parameter that helps the adapter determine whether it can just modify the way it binds a cursor’s data, which I think is impossible, or just plain difficult; not to mention lead to performance problems).

Thanks in advance!

  • 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-24T11:11:18+00:00Added an answer on May 24, 2026 at 11:11 am

    What if your SQL query was:

    SELECT _id, name, date, truth_value FROM table_name ORDER BY truth_value, date
    

    This should order the items in the way you want. Then in your CursorAdapter you could check the value of truth_value, and when it changes, do something different. Although I’m not sure exactly what it is you are trying to achieve with the layout.

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

Sidebar

Related Questions

I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a text area in my form which accepts all possible characters from
I am writing an app with both english and french support. The app requests
I'm parsing an XML file, the creators of it stuck in a bunch social
I am using Paperclip to handle profile photo uploads in my app. They upload

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.