title: Android Custom adapter image list view with swipe tabs
body: <p>I am trying to make an Android application with tabs and swipe view, and I have a list view inside one tab, and also I have added an image view to the list and I used a custom adapter to fill data in the list, I have  some errors while loading data to the list (but works perfectly fine activity classes ) , lines and errors are 
  written below </p>
  
  <pre><code> Adapter adapter=new Adapter(this, names , distripton, price, images); 
  </code></pre>
  
  <pre class="lang-none prettyprint-override"><code> error is the constructor Adapter(javafragment,string[],string[])is undefined
  </code></pre>
  
  <p>My xml page is </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="match_parent"
      android:layout_height="match_parent"
      android:background="@android:color/holo_red_dark"
       &gt;
       &lt;ListView
          android:id="@+id/listView1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" &gt;
      &lt;/ListView&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>And the java fragment class is </p>
  
  <pre><code>package com.example.newlistimage;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ListView;
  
  public class Javaframent extends Fragment {
  
      ListView lv;
      String[] names={"haseem","hac"};
      String[] distripton={"dis1","dis2"};
      String[] price={"10","20"};
      int[] images={R.drawable.ic_launcher,R.drawable.ic_launcher};
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          // TODO Auto-generated method stub
  
          lv=(ListView) getActivity().findViewById(R.id.listView1);
          Adapter adapter=new Adapter(this, names , distripton, price, images);
          lv.setAdapter(adapter);
  
          return inflater.inflate(R.layout.java_layout ,container,false);
      }
  
  }
  </code></pre>
  
  <p>The custom adapter class</p>
  
  <pre><code>package com.example.newlistimage;
  
    import android.content.Context;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.ArrayAdapter;
    import android.widget.ImageView;
    import android.widget.TextView;
  
  public class Adapter extends ArrayAdapter&lt;String&gt;  {
  
      int[] images={};
      String[] names={};
      String[] prices={};
      String[] discriptions={};
      Context c;
      LayoutInflater inflater; 
  
  
          public Adapter(Context context,String[] names,String[] distrion,String[]    price,int[] img) {
          super(context, R.layout.model,names);
              this.c=context;
              this.names=names;
              this.prices=price;
              this.discriptions=distrion;
              this.images=img;
  
      }
  
      public class ViewHolder
      {
          TextView nametv;
          TextView discriptiontv;
          TextView pricetv;
          ImageView images;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          // TODO Auto-generated method stub
  
  
          if(convertView==null)
          {
              inflater=(LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              convertView=inflater.inflate(R.layout.model, null);
  
          }
  
          final ViewHolder holder=new ViewHolder();
          holder.nametv=(TextView) convertView.findViewById(R.id.nametv);
          holder.discriptiontv=(TextView) convertView.findViewById(R.id.discriptiontv);
          holder.pricetv=(TextView) convertView.findViewById(R.id.moneytv);
          holder.images=(ImageView) convertView.findViewById(R.id.imageView1);
  
          holder.images.setImageResource(images[position]);
          holder.nametv.setText(names[position]);
          holder.pricetv.setText(prices[position]);
          holder.discriptiontv.setText(discriptions [position]);
  
      //  return super.getView(position, convertView, parent);
          return convertView;
      }
  
  }
  </code></pre>