im using a listview to display a picture and a name. The problem im having is when i fling the listview it has a very choppy scroll. Im using the Android query lib to load the images. I get a lot of GC_FOR ALLOC freed in the logcat. Not sure what is causing it. Any help please?
listview xml :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="70dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:orientation="horizontal" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerInParent="true"
android:src="@drawable/grey2" />
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerInParent="true"
android:src="@drawable/grey2" />
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
getview method:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
final ViewHolder holder;
// convertView = null;
if (convertView == null) {
convertView = LayoutInflater.from(context).inflate(
R.layout.layout, parent, false);
holder = new ViewHolder();
holder.pic=(ImageView)convertView.findViewById(R.id.pic);
holder.fname=(TextView)convertView.findViewById(R.id.fname);
holder.name=(TextView)convertView.findViewById(R.id.name);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
aq2= aq.recycle(convertView);
holder.name.setText(first_name + " " + last_name );
holder.username.setText(username);
q2.id(holder.pic).image(urrl);
return convertView;
}
static public class ViewHolder {
TextView fname;
TextView name;
ImageView pic;
}