开发者

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??


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜