Edittext Content Changes On Listview Scroll
I have an Android application with an customized adapter that extends Cursor Adapter. I overrided bindView and newview methods of CursorAdapter. Each of my ListView row contains a
Solution 1:
If you're having problem after scrolling it's the view recycling that's messing you up. You basically need to set up an array to hold the contents of the EditTexts so when you scroll they don't get messed up.
Here's a link to another answer I gave on a similar topic. It ought to point the way for you. SO Answer
EDIT
I use setOnFocusChangeListener
to run code when the user finishes an entry in the EditText box.
qty.setOnFocusChangeListener(newView.OnFocusChangeListener() {
@OverridepublicvoidonFocusChange(View v, boolean hasFocus) {
if (!hasFocus) {
LinearLayoutparent= (LinearLayout) v.getParent();
EditTextqtyTemp= (EditText) parent.findViewById(R.id.qty);
quantity[pos] = qtyTemp.getText().toString();
}
}
});
Post a Comment for "Edittext Content Changes On Listview Scroll"