I have a fully functional listview
(in a ListFragment
) with a custom ArrayAdapter
.
The layout of the adapter consists of an imageview
, a button
, a gridview
and a couple of textviews
.
The problem is the listview is very jittery while scrolling. I have implemented the ViewHolder
pattern and it improved the performance just a little.
The GridView
consists of contact images which i am retrieving in a AsyncTask
and also using application cache to display the bitmaps.
What else can i do to make this listview
scroll smooth?
I have used view recycling as shown below in my getView
method of the adapter
public View getView(int position, View convertView, ViewGroup parent) {
View myView;
holder = new ViewHolder();
if (convertView == null) {
inflater = (LayoutInflater) getContext().getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
myView = inflater.inflate(R.layout.events_list_activity, parent, false);
}
else {
myView = convertView;
}
}