Android: Alignment/ Layout issues while using different Data Structures
===

I have a custom listview in my application. The needs of the user varies with option he selects and the result is on the listview. I am representing the same list once by using `ArrayList<String>` and other time, while using  `ArrayList<HashMap<String,String>>`. Now, while using the former i.e. `ArrayList<String>`, the result in the listView row gets aligned perfectly but then, while using the later i.e. `ArrayList<HashMap<String,String>>` the alignment gets worse. I am not understanding what the problem can be. Please help!

Below I am posting the source code of the XML which is used as a row in my custom Listview.

> <?xml version="1.0" encoding="utf-8"?> <RelativeLayout
> xmlns:android="http://schemas.android.com/apk/res/android"
>     android:id="@+id/RelativeLayout1"
>     android:layout_width="180dip"
>     android:layout_height="wrap_content"
>     android:orientation="vertical" >
> 
>      <LinearLayout
>          android:id="@+id/ll_list_header"
>          android:layout_width="fill_parent"
>          android:layout_height="wrap_content" >
>                     
>                     <TextView
>                     android:id="@+id/txt_id"
>                     android:layout_width="0dp"
>                     android:layout_height="wrap_content"
>                     android:layout_weight="0.05"
>                     android:gravity="center"
>                     android:text="ID"
>                     android:textSize="6dip"
>                     android:textStyle="bold" />
> 
>                 <View
>                     android:id="@+id/view1"
>                     android:layout_width="1dip"
>                     android:layout_height="fill_parent"
>                     android:background="#e5e5e5" />
> 
>                 <TextView
>                     android:id="@+id/txt_name"
>                     android:layout_width="0dp"
>                     android:layout_height="wrap_content"
>                     android:layout_weight="0.07"
>                     android:gravity="center"
>                     android:text="Name"
>                     android:textSize="6dip"
>                     android:textStyle="bold"/>
> 
>                 <View
>                     android:id="@+id/view2"
>                     android:layout_width="1dip"
>                     android:layout_height="fill_parent"
>                     android:background="#e5e5e5" />
> 
>                 <View
>                     android:id="@+id/view3"
>                     android:layout_width="1dip"
>                     android:layout_height="fill_parent"
>                     android:background="#e5e5e5" /> -->
> 
>                 <TextView
>                     android:id="@+id/txt_bname"
>                     android:layout_width="0dp"
>                     android:layout_height="wrap_content"
>                     android:layout_weight="0.12"
>                     android:gravity="center"
>                     android:text="Brand Name"
>                     android:textSize="6dip"
>                     android:textStyle="bold"/>
> 
>                 <View
>                     android:id="@+id/view3"
>                     android:layout_width="1dip"
>                     android:layout_height="fill_parent"
>                     android:background="#e5e5e5" />
>                 
>                 <TextView
>                     android:id="@+id/txt_vendor"
>                     android:layout_width="0dp"
>                     android:layout_height="wrap_content"
>                     android:layout_weight="0.08"
>                     android:gravity="center"
>                     android:text="Vendor"
>                     android:textSize="6dip"
>                     android:textStyle="bold"/>
> 
>                 <View
>                     android:id="@+id/view27"
>                     android:layout_width="1dip"
>                     android:layout_height="fill_parent"
>                     android:background="#e5e5e5" />
>                 
> 
>                 <TextView
>                     android:id="@+id/txt_openingstock"
>                     android:layout_width="0dp"
>                     android:layout_height="wrap_content"
>                     android:layout_weight="0.09"
>                     android:gravity="center"
>                     android:text="Opening Stock"
>                     android:textSize="6dip"
>                     android:textStyle="bold"/>
> 
>                 <View
>                     android:id="@+id/view26"
>                     android:layout_width="1dip"
>                     android:layout_height="fill_parent"
>                     android:background="#e5e5e5" />
>                 
> 
>                 <TextView
>                     android:id="@+id/txt_availablestock"
>                     android:layout_width="0dp"
>                     android:layout_height="wrap_content"
>                     android:layout_weight="0.09"
>                     android:gravity="center"
>                     android:text="Available Stock"
>                     android:textSize="6dip"
>                     android:textStyle="bold"/>
> 
>                 <View
>                     android:id="@+id/view25"
>                     android:layout_width="1dip"
>                     android:layout_height="fill_parent"
>                     android:background="#e5e5e5" />
>                 
>                 <TextView
>                     android:id="@+id/txt_addstock"
>                     android:layout_width="0dp"
>                     android:layout_height="20dp"
>                     android:layout_weight="0.10"
>                     android:gravity="center"
>                     android:hint="Rs."
>                     android:textSize="6dip"
>                     android:textStyle="bold" />
> 
>                 <View
>                     android:id="@+id/view24"
>                     android:layout_width="1dip"
>                     android:layout_height="fill_parent"
>                     android:background="#e5e5e5" />
>                 
>                 <TextView
>                     android:id="@+id/txt_salesprice"
>                     android:layout_width="0dp"
>                     android:layout_height="20dp"
>                     android:layout_weight="0.10"
>                     android:gravity="center"
>                     android:hint="Rs."
>                     android:textSize="6dip"
>                     android:textStyle="bold" android:width="7dp" />
>                 <View
>                     android:id="@+id/view24"
>                     android:layout_width="1dip"
>                     android:layout_height="fill_parent"
>                     android:background="#e5e5e5" />
>                 
>                 <TextView
>                     android:id="@+id/txt_purchaseprice"
>                     android:layout_width="0dp"
>                     android:layout_height="20dp"
>                     android:layout_weight="0.12"
>                     android:gravity="center"
>                     android:hint="Rs."
>                     android:textSize="6dip"
>                     android:textStyle="bold"  android:width="7dp"/>
>        </LinearLayout> </RelativeLayout>