to add a last row in listview
<p>i have a custom listview i want to add one lat row to it which will calculate total of all the list when i scroll the last row gets added again and again </p>

<pre><code>if(position==searchResult.size() &amp;&amp; searchResult.size()!=1)
         {

                holder.checkImg.setVisibility(ImageView.GONE);
                holder.fvtImg.setVisibility(ImageView.GONE);
                holder.type.setVisibility(TextView.GONE);
                holder.name.setVisibility(TextView.GONE);
                holder.offer_price.setVisibility(TextView.GONE);
                holder.real_price.setVisibility(TextView.GONE);

                holder.total.setVisibility(TextView.VISIBLE);
                holder.total_price.setVisibility(TextView.VISIBLE);

                //DecimalFormat df = new DecimalFormat("0.00");  
                 //holder.txt_distance.setText(df.format(mData.get(position).get("distance")).toString()+"...");

                DecimalFormat twoDForm = new DecimalFormat("0.00");
                String totalPrice = (twoDForm.format(mTotalPrice)+"").replace('.',',');

                holder.total.setText("Total");
                holder.total_price.setText("Kr. "+totalPrice);
         }
         else
         {
             holder.total.setVisibility(TextView.GONE);
                holder.total_price.setVisibility(TextView.GONE);
                     if(isEdit){
                         /*LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
                           lp.leftMargin=30;
                           holder.fvtImg.setLayoutParams(lp);*/
                        /* TranslateAnimation anim = new TranslateAnimation(0,35,0,0);
                         holder.fvtImg.setAnimation(anim);
                         anim.setFillAfter(true);*/
                            holder.fvtImg.setVisibility(ImageView.GONE);
                            holder.name.setPadding(10,0, 0, 0);
                            holder.type.setPadding(10,0, 0, 0);
                            holder.checkImg.setVisibility(ImageView.VISIBLE);
</code></pre>

<p>Layout file :  </p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
&gt;

  &lt;ImageView 
   android:id="@+id/list_background"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:background="@drawable/price_list_background"
  /&gt; 
    &lt;CheckBox android:id="@+id/checkBox" 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content" 
    android:layout_centerVertical="true" 
    android:layout_alignParentLeft="true"
    android:visibility="gone"&gt;
    &lt;/CheckBox&gt;

  &lt;ImageView 
   android:id="@+id/img_pol"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:background="@drawable/pol_icon_tag"
   android:layout_centerVertical="true"
   android:layout_marginLeft="5dp"  
  /&gt; 

  &lt;TextView 
   android:id="@+id/txt_name"
   android:layout_width="wrap_content"
   android:layout_height="15dp"
   android:textSize="16dp"
   android:textColor="#000000"
   android:layout_marginTop="5dp"
   android:layout_marginLeft="35dp"
  /&gt;
  &lt;TextView 
   android:id="@+id/txt_type"
   android:layout_width="200dp"
   android:layout_height="13dp"
   android:textSize="12dp"
   android:textColor="#464647"
   android:layout_marginTop="35dp"
   android:layout_marginLeft="35dp"
  /&gt;
  &lt;TextView 
   android:id="@+id/txt_real_price"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:textSize="12dp"
   android:textColor="#464647"
   android:layout_marginTop="35dp"
   android:layout_marginLeft="90dp"
  /&gt;
  &lt;TextView 
   android:id="@+id/txt_offer_price"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:textSize="16dp"
   android:textColor="#464647"
   android:layout_marginTop="31dp"
   android:layout_marginLeft="190dp"
  /&gt;

  &lt;TextView 
   android:id="@+id/txt_total"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:textSize="15dp"
   android:textColor="#464647"
   android:layout_centerVertical="true"
   android:layout_marginLeft="100dp"
   android:text="Total"
   android:visibility="gone"
  /&gt;
  &lt;TextView 
   android:id="@+id/txt_total_price"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:textSize="16dp"
   android:textColor="#464647"
   android:layout_centerVertical="true"
   android:layout_marginLeft="230dp"
   android:text="kr. 222.22"
   android:visibility="gone"
  /&gt;


  &lt;/RelativeLayout&gt;
</code></pre>
