简体   繁体   中英

how to not get refreshed when scrolling listview in android

i don't want my list view to be refreshed

when i scroll screen list view gets refreshed...

i don't want it to happen...what should i do

  <ListView android:id="@+id/android:list"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:layout_below="@id/edittxt_username"
              android:scrollbars="vertical"
                android:layout_marginBottom="0sp"
              />

okey editing my real need

am using a checkbox in my listview `

final CheckBox chb = (CheckBox) v.findViewById(R.id.editcheckbox);

                    chb.setOnClickListener(new OnClickListener() {

                        @Override
                        public void onClick(View view) {
                            if (chb.isChecked() == true) {
                                CheckedMessages.add(f);

                            } else if (chb.isChecked() == false) {
                                CheckedMessages.remove(f);
                            }
                        }
                    });`

suppose there 20 items in list.. i check the first one..after a scroll i see 6th item checked...again scrollling i see 13th item checked...i tot it might be due to refreshing...whts the reason??

Check this video about ListView Google IO 2010 - World of ListView

I think this is not possible. And you have something wrong in your app design. Please give more details, on why you do not wont your ListView items to be refreshed while scrolling.

When ListView is scrolled, it uses ListAdapter to show new items. Each time new item becomes visible, ListView asks adapter to refresh this item's view. Also ListView may cache some items' views for performance reasons.

I'm not sure what exactly you want to achieve, but you can't disable ListView refreshing. That's basically one of the reason ListView was implemented in the first place: smart refreshing.

You should describe what you want to achieve, I've got feeling that it's not related with ListView refreshing itself.

You can use Pull To Refresh

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM