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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:11:40+00:00 2026-06-17T01:11:40+00:00

I am using Custom ListView in My Android App. The Problem is when i

  • 0

I am using Custom ListView in My Android App. The Problem is when i am scrolling ListView, it automatically clears entered data from EditText( Edittext as a list_item ) and it ListView refreshed. I Want to Prevent it to stop clearing entered data on ListView Scroll.
Please Help me..

  • 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-17T01:11:41+00:00Added an answer on June 17, 2026 at 1:11 am

    1) define custom list adapter

    2) define a an object for each item like class MyClass { String myText}

    3) store the value of the EditText of each item in that object

    I have a code for storing the state of CheckBox. use and customize it for EditText.

    protected interface MyTextWatcher extends TextWatcher {
    
        public void setEnabled(EditText editText, boolean enable);
    
        public void setText(EditText editText, String text);
    }
    
    private MyTextWatcher generalTextWatcher = new MyTextWatcher() {
    
            private boolean enabled_edtQty = true;
            private boolean enabled_edtPackingQty = true;
    
            public void setEnabled(EditText editText, boolean enable) {
                if (editText.equals(edtQty))
                {
                    this.enabled_edtQty = enable;
                }
                else if (editText.equals(edtPackingQty))
                {
                    this.enabled_edtPackingQty = enable;
                }
            }
    
            @Override
            public void onTextChanged(CharSequence s, int start, int before,
                    int count) {
                if (this.enabled_edtQty && edtQty != null
                        && edtQty.getText().hashCode() == s.hashCode())
                {
                    edtQty_onTextChanged(s, start, before, count);
                }
                else if (this.enabled_edtPackingQty && edtPackingQty != null
                        && edtPackingQty.getText().hashCode() == s.hashCode())
                {
                    edtPackingQty_onTextChanged(s, start, before, count);
                }
            }
    
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count,
                    int after) {
    
            }
    
            @Override
            public void afterTextChanged(Editable s) {
    
            }
    
            @Override
            public void setText(EditText editText, String text) {
    
                this.setEnabled(editText, false);
    
                editText.setText(text);
    
                this.setEnabled(editText, true);
            }
    
        };
    
    
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
    
                View rowView;
                final MyClass item = getItem(position);
    
                 edtQty.addTextChangedListener(generalTextWatcher);
                 edtPackingQty.addTextChangedListener(generalTextWatcher);
    
                 generalTextWatcher.setText(edtQty, item.myText1);
                 generalTextWatcher.setText(edtPackingQty, item.myText2);
    
    
        }
    
    
        protected void edtQty_onTextChanged(CharSequence s, int start, int before,
                int count) {
                                  item.myText1 = s;
                }
    
        protected void edtPackingQty_onTextChanged(CharSequence s, int start, int before,
                int count) {
                                  item.myText2 = s;
                }
    

    in your situation you should use addTextChangedListener instead of setOnCheckedChangeListener

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

Sidebar

Related Questions

I'm using a custom listview I found here: http://developer.android.com/resources/samples/ApiDemos/res/layout/linear_layout_9.html Seems to be valid in
Hi I am developing one app using the below link Custom ListView With Headers
i have a problem using the standard android listview. if the text is to
I'm using a custom ListView in android to display somedata ... By default i
HI Guyz i have created a sectioned custom listview using baseadapter its working fine
I am using custom row view in ListView widget. I am having getView method
I've got a ListView that is populated using a custom BaseAdapter (MyBaseAdapter) : public
I am displaying images and text to a listview using a custom adapter, when
I'm using custom class that subclass from UILabel. It works fine unless I change
I'm testing my android app using robotium , I have used fragments in my

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.