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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:47:16+00:00 2026-05-27T10:47:16+00:00

After the completion of the Notepad tutorials I’ve managed to add a rating bar

  • 0

After the completion of the Notepad tutorials I’ve managed to add a rating bar in the edit note section, allowing the user to interact with it and rate the note,this being saved in the SQL database. Now I’m trying to add the rating bar in the fillData() method which defines the row elements of the list allowing to easily populate the list with entries from the database. But the problem is that the program crahses because of the R.id.rating and I don’t know how to fix it. Is there a way to display the rating along with the notes in the primary list view? Thank You

private void fillData() {
    Cursor notesCursor = mDbHelper.fetchAllNotes();
    startManagingCursor(notesCursor);

    // Create an array to specify the fields we want to display in the list 
    String[] from = new String[]{NotesDbAdapter.KEY_TITLE,NotesDbAdapter.KEY_BODY,NotesDbAdapter.KEY_RATING};

    // and an array of the fields we want to bind those fields to 
    int[] to = new int[]{R.id.text1,R.id.text2,R.id.rating};

    // Now create a simple cursor adapter and set it to display
    SimpleCursorAdapter notes = 
        new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from, to);
    setListAdapter(notes);
}
  • 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-27T10:47:16+00:00Added an answer on May 27, 2026 at 10:47 am

    SimpleCursorAdapter only supports TextViews and ImageViews and does not support RatingBar

    Refer for details:

    http://developer.android.com/reference/android/widget/SimpleCursorAdapter.html

    Now to display RatingBar in ListView, you have to use CursorAdapter and use its newView to create and bindView to set the rating value. You can also use ListAdapter which is more verbose to use.

    Refer to:

    http://developer.android.com/reference/android/widget/CursorAdapter.html
    http://developer.android.com/reference/android/widget/ListAdapter.html

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

Sidebar

Related Questions

I want execute below callback() method after completion of document.getElementById('btnDownload').click(); method . Now callback()
How to make .BAT file delete it self after completion? I have a simple
I have a UITextfield for entering text. A button triggers a functionality. After completion
How can I create a setup file in visual basic 6 after completion of
I need to execute 3 parallel tasks and after completion of each task they
After completion of some work in Middleware C library, Need to show few notifications
How can we set the timer so that after completion of an Image-view animation,
I have a registration form that includes sfRegistration and sfProfile, which after completion, get's
I'm using curl to fill a form. After completion of the post the other
Do the international students get a job offer in Australia after completing their Masters degree from University of Melbourne?

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.