I have a list view in this activity
First, i will display list view with this
adapter = new CustomAdapter_LatestNews(this, title, category, date,
imagepath);
lv.addFooterView(constant.AdMob());
lv.setAdapter(adapter);
I am using custom adapter which extend base adapter.
public View getView(int position, View convertView, ViewGroup parent)
In this activity, i have a refresh button which was update data and call back same activity.
startActivity(new Intent(Main_AllLatestNews.this, Main_AllLatestNews.class));
finish();
It seem like the getview is reusing the data?
Before press refresh button
result > image 0 0 0 0 1 0 1 0 0 0 correct display (no matter how i scroll)
After press refresh button
result > image 1 1 1 1 1 1 1 1 1 1 incorrect display (scroll will cause this)
How to solve this problem?
the right way to refresh list view is not by restarting the activity.
instead – after refreshing the logic list /or the data the adapter working with, all you need to do is to call: