Android:listview item problem?
<p>Hi I created a list view and Item,The item contains 2 linear layouts and i want to visible these layout on the ,depends on values  ,i tried to do this in getview of adapter but its not working prperly my code shows below<br/>
<strong>Item.xml</strong></p>

<pre><code>&lt;LinearLayout android:id="@+id/LinearLayout00"
    android:layout_width="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:gravity="fill_horizontal"
    android:hapticFeedbackEnabled="true"
    android:layout_gravity="fill_horizontal"
    android:alwaysDrawnWithCache="true" android:background="#ccc"
    android:layout_height="wrap_content"&gt;
    &lt;LinearLayout android:id="@+id/LinearLayout01"
        android:layout_width="fill_parent" android:orientation="horizontal"
        android:gravity="fill_horizontal"
        android:hapticFeedbackEnabled="true"
        android:layout_gravity="fill_horizontal"
        android:alwaysDrawnWithCache="true" android:background="#ccc"
        android:layout_height="wrap_content"&gt;
        &lt;ImageView android:id="@+id/image"
            android:layout_width="50dip" android:layout_height="50dip"
            android:src="@drawable/stub" android:scaleType="centerCrop"
            android:background="#000000" android:layout_margin="5dip" /&gt;
        &lt;LinearLayout android:id="@+id/LinearLayout01"
            android:layout_height="wrap_content"
            android:layout_gravity="fill_horizontal"
            android:layout_width="fill_parent" android:orientation="vertical"
            android:paddingLeft="5dip" android:paddingRight="5dip"&gt;
            &lt;TextView android:id="@+id/text" android:text="Username"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1" android:layout_gravity="left|center_vertical"
                android:textColor="#111" /&gt;
            &lt;TextView android:layout_height="wrap_content"
                android:id="@+id/Story" android:text="Story"
                android:layout_width="fill_parent" android:textColor="#111"
                android:textColorHighlight="#06f" android:textStyle="bold"
                android:typeface="sans" android:textSize="15dip" /&gt;
            &lt;TextView android:layout_height="wrap_content"
                android:id="@+id/Time" android:text="12 hours ago"
                android:layout_width="fill_parent" android:textColor="#333"
                android:textSize="11dip" android:paddingBottom="5dip" /&gt;
            &lt;TextView android:layout_height="wrap_content"
                android:id="@+id/Pid" android:visibility="gone"
                android:layout_width="fill_parent" android:textSize="0dip" /&gt;
        &lt;/LinearLayout&gt;
    &lt;/LinearLayout&gt;
    &lt;LinearLayout android:id="@+id/LinearLayout02"
        android:layout_height="wrap_content"
        android:layout_gravity="fill_horizontal"
        android:layout_width="fill_parent" android:orientation="vertical"
        android:visibility="gone" android:paddingLeft="5dip"

        android:paddingRight="5dip"&gt;
        &lt;TextView android:layout_height="wrap_content"
            android:id="@+id/follows" android:text="12 hours ago"
            android:layout_width="fill_parent" android:textColor="#333"
            android:textSize="11dip" android:paddingBottom="5dip" /&gt;
        &lt;TextView android:layout_height="wrap_content"
            android:id="@+id/followData" android:text="Click"
            android:clickable="true" android:layout_width="fill_parent"
            android:textColor="#333" android:textSize="11dip"
            android:paddingBottom="5dip" /&gt;
    &lt;/LinearLayout&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p><strong>java file</strong></p>

<pre><code>public View getView(int position, View convertView, ViewGroup parent) {

    View vi=convertView;
    ViewHolder holder;

    Post o=listItems1.get(position);

    if(convertView==null){

        vi = inflater.inflate(R.layout.item, null);
        holder=new ViewHolder();

        LinearLayout ly1=(LinearLayout)vi.findViewById(R.id.LinearLayout01);
        LinearLayout ly2=(LinearLayout)vi.findViewById(R.id.LinearLayout02);
        if(o.getPostType().equals("0"))
        {
            ly1.setVisibility(View.VISIBLE);
            ly2.setVisibility(View.GONE);
        }
        else
        {
            ly2.setVisibility(View.VISIBLE);
            ly1.setVisibility(View.GONE);
        }
        //ly.setVisibility(View.VISIBLE);

        holder.text=(TextView)vi.findViewById(R.id.text);
        holder.story=(TextView)vi.findViewById(R.id.Story);
        holder.timeSpan=(TextView)vi.findViewById(R.id.Time);
        holder.image=(ImageView)vi.findViewById(R.id.image);
        holder.pid=(TextView)vi.findViewById(R.id.Pid);

        holder.follows=(TextView)vi.findViewById(R.id.follows);
        holder.followsData=(TextView)vi.findViewById(R.id.followData);

        vi.setTag(holder);

    }
    else
        holder=(ViewHolder)vi.getTag();

    holder.text.setText(o.getUserName());
    holder.story.setText(Html.fromHtml(o.getStory()));
    holder.timeSpan.setText(o.getTime());
    holder.pid.setText(""+o.getPid());

    holder.image.setTag(listItemsUrl.get(position).toString());
    imageLoader.DisplayImage(listItemsUrl.get(position).toString(), activity, holder.image);

    return vi;

}
</code></pre>

<p>please help me
<br/>
Regard Augustine</p>
