Here is the code of my custom adapter... it doesn't call my get view... returns only white blank page without nothing. I don't know what is the problem. Does anybody can help. Thanks a lot previously!
public class ProductShopsAdapter extends ArrayAdapter<ProductShop> {
private Context cntx;
private ArrayList<ProductShop> shopValues;
ProductShopsHolder holder = null;
public ProductShopsAdapter(Context context, int textViewResourceId, ArrayList<ProductShop> stringValues) {
super(context,textViewResourceId);
shopValues = stringValues;
cntx = context;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
holder = new ProductShopsHolder();
LayoutInflater layoutInflater = (LayoutInflater)cntx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = layoutInflater.inflate(R.layout.shops_list, null);
//Holder Elements initialization
holder.setShopName((TextView)convertView.findViewById(R.id.shop_name));
holder.setPrice((TextView)convertView.findViewById(R.id.shop_part_price));
convertView.setTag(holder);
} else {
holder = (ProductShopsHolder) convertView.getTag();
}
holder.getShopName().setText(getItem(position).getShopName());
holder.getPrice().setText(getItem(position).getPrice());
return convertView;
}
}
and here is my XML
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ProductShopsActivity" >
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/footer"
android:padding="0dp" >
</ListView>
<include
android:id="@+id/footer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@android:id/list"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
layout="@layout/footer_menu" />
</RelativeLayout>
and single view :
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_item"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#f2f2f2"
android:orientation="horizontal"
android:padding="10dp" >
<TextView
android:id="@+id/shop_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Technomarket"
android:textSize="14sp" />
<TextView
android:id="@+id/shop_part_price"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="30 лв."
android:textSize="18sp" />
<TextView
android:id="@+id/details_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableRight="@drawable/rightarrow"
android:gravity="center"
android:text="Детайли"
android:textColor="#289bd6"
android:textSize="14sp" />