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

  • SEARCH
  • Home
  • 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 842247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:55:43+00:00 2026-05-15T05:55:43+00:00

I have a long scrolling list of EditText items created by a SimpleCursorAdapter and

  • 0

I have a long scrolling list of EditText items created by a SimpleCursorAdapter and prepopulated with values from an SQLite database.

I make this by:

cursor = db.rawQuery("SELECT _id, criterion, localweight, globalweight FROM " + dbTableName + " ORDER BY criterion", null);

startManagingCursor(cursor);

mAdapter = new SimpleCursorAdapter(this, R.layout.weight_edit_items, cursor, new String[]{"criterion","localweight","globalweight"}, new int[]{R.id.criterion_edit, R.id.localweight_edit, R.id.globalweight_edit});    

this.setListAdapter(mAdapter);

The scrolling list is several emulator screens long. The items display OK – scrolling through them shows that each has the correct value from the database.

I can make an edit change to any of the EditTexts and the new text is accepted and displayed in the box.

But… if I then scroll the list far enough to take the edited item off the screen, when I scroll back to look at it again its value has returned to what it was before I made the changes, i.e. my edits have been lost.

In trying to sort this out, I’ve done a getText to look at what’s in the EditText after I’ve done my edits (and before a scroll) and getText returns the original text, even though the EditText is displaying my new text. It seems that the EditText has only accepted my edits superficially and they haven’t been bound to the EditText, meaning they get dropped when scrolled off the screen.

Can anyone please tell me what’s going on here and what I need to do to force the EditText to retain its edits?

  • 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-15T05:55:44+00:00Added an answer on May 15, 2026 at 5:55 am

    But…if I then scroll the list far
    enough to take the edited item off the
    screen, when I scroll back to look at
    it again its value has returned to
    what it was before I made the changes,
    ie. my edits have been lost.

    Of course.

    List rows get recycled. Your Cursor may have 1,000 records, but there are not going to be 1,000 EditText widgets created if you scroll through the list. Rather, there will be 10 or so, depending on how many rows are simultaneously visible. Rows get recycled, and the binding operation will replace the old EditText value with a new value from the Cursor for whatever row just scrolled onto the screen, replacing whatever was there before (previous value from the database or a user-edited value).

    And, since a regular Cursor is immutable, you have no way of persisting any edits in a way that will transparently be put back into the list.

    I suspect it is possible to create a ListView with rows that are EditTexts, probably by creating a custom Adapter class and handling all the row recycling yourself. However, it is going to be a fair amount of work, and the built-in classes will only give you a bit of support for this pattern.

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

Sidebar

Related Questions

I have make on demo that list all contact from contact Uri in that
I have long file with the following list: /drivers/isdn/hardware/eicon/message.c//add_b1() /drivers/media/video/saa7134/saa7134-dvb.c//dvb_init() /sound/pci/ac97/ac97_codec.c//snd_ac97_mixer_build() /drivers/s390/char/tape_34xx.c//tape_34xx_unit_check() (PROBLEM)/drivers/video/sis/init301.c//SiS_GetCRT2Data301() /drivers/scsi/sg.c//sg_ioctl()
I'm trying to find all data items that have long/lats that are contained by
I have the following problem: I have to list several items each with several
What are there the usability implications for a long list of items (f.e. facebook
I have created a specific List which exists out of the following elements to
I have fancy looking jQuery Multiple checkbox/selectbox list script. Look HERE for demo. This
I have top bar, list and bottom bar. this.setLayout(new BorderLayout()); this.addComponent(BorderLayout.NORTH, bottomBar); this.addComponent(BorderLayout.CENTER, list);
I have a potentially very long scrolling log of messages within a UITableView The
I have a carbon application with a list view data browser and vertical scrolling.

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.