title: Custom List View doesn't call Getview () method .
body: <p>I don't know why but my Custom List view is not working . When I call ListView.setadapter , my adapter don't call getView() method . I figured this problem about 2 day straight But I don't know why . No Error No working . Help me Pls . This is serious</p>
  
  <p>This is my <strong>Custom Adapter</strong> Code : </p>
  
  <pre><code> import java.util.ArrayList;
      import android.app.Activity;
      import android.content.Context;
      import android.content.res.Resources;
      import android.util.Log;
      import android.view.LayoutInflater;
      import android.view.View;
      import android.view.ViewGroup;
      import android.widget.BaseAdapter;
      import android.widget.ImageButton;
      import android.widget.ImageView;
      import android.widget.TableRow;
      import android.widget.TextView;
  
  public class CustomAdapter extends BaseAdapter{
  
      private Activity activity;//for parameter
      private ArrayList data;//for parameter
      public Resources res;//for parameter
      private static LayoutInflater inflater=null;
      ListModel getList ;
      int i=0;
  
       public CustomAdapter(Activity a, ArrayList data,Resources resLocal) {
  
  
              activity = a;
              this.data=data;
              res = resLocal;
  
              /***********  Layout inflator to call external xml layout () **********************/
              inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
          }
      @Override
      public int getCount() {
          if (data.size()&lt;=0)
              return 1;
          return 0;
      }
  
      @Override
      public Object getItem(int position) {
          // TODO Auto-generated method stub
          return position;
      }
  
      @Override
      public long getItemId(int position) {
          // TODO Auto-generated method stub
          return position;
      }
  
      public static class ViewHolder{
  
          public ImageView image;
          public TextView txt_memberName;
          public TextView txt_memberStatus;
          public ImageButton imgbtn_senka;
          public ImageButton imgbtn_fuenka;
          public TableRow tblrow_status;
          public TableRow tblrow_btn;
  
  
      }
  
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          // TODO Auto-generated method stub
          ViewHolder holder = new ViewHolder();;
          View vi=convertView;
          Log.i("tag", "INVIEW");
  
          holder.txt_memberName=(TextView)vi.findViewById(R.id.txtmemberName);
          holder.txt_memberStatus=(TextView)vi.findViewById(R.id.txtmemberStatus);
          holder.image=(ImageView)vi.findViewById(R.id.imgPlayer);
          holder.imgbtn_fuenka = (ImageButton) vi.findViewById(R.id.btnfusenka);
          holder.imgbtn_senka = (ImageButton) vi.findViewById(R.id.btnsenka);
          holder.tblrow_status = (TableRow)vi.findViewById(R.id.tblrowstatus);
          holder.tblrow_status = (TableRow)vi.findViewById(R.id.tblrowbtn);
  
          if(convertView==null){
  
              /********** Inflate tabitem.xml file for each row ( Defined below ) ************/
              vi = inflater.inflate(R.layout.tabitem, null);
  
  
              holder.txt_memberName=(TextView)vi.findViewById(R.id.txtmemberName);
              holder.txt_memberStatus=(TextView)vi.findViewById(R.id.txtmemberStatus);
              holder.image=(ImageView)vi.findViewById(R.id.imgPlayer);
              holder.imgbtn_fuenka = (ImageButton) vi.findViewById(R.id.btnfusenka);
              holder.imgbtn_senka = (ImageButton) vi.findViewById(R.id.btnsenka);
              holder.tblrow_status = (TableRow)vi.findViewById(R.id.tblrowstatus);
              holder.tblrow_status = (TableRow)vi.findViewById(R.id.tblrowbtn);
  
             /************  Set holder with LayoutInflater ************/
              vi.setTag(holder);
          }
          else
              holder=(ViewHolder)vi.getTag();
  
          if(data.size()&lt;=0)
          {
              Log.i("Tag", "No Data");
  
          }
  
          else
          {
              /***** Get each Model object from Arraylist ********/
              getList=null;
              getList = (ListModel) data.get(position);
              if(getList.getMemberStatus()==2){
                  Log.i("null", "2");
  
                  //holder.tblrow_btn.setVisibility(View.GONE);
              }
              /************  Set Model values in Holder elements ***********/
               holder.txt_memberName.setText(getList.getMemberName());
               holder.txt_memberStatus.setText(getList.getImage());
               holder.image.setImageResource(res.getIdentifier("com.androidexample.customlistview:drawable/"+getList.getImage(),null,null));
               holder.txt_memberName.setText(getList.getMemberName());
               holder.image.setImageResource(res.getIdentifier("com.androidexample.customlistview:drawable/"+getList.getImage(),null,null));
  
          }
          return vi;
  
  
      }
  
   }
  </code></pre>
  
  <p>This is where I call <strong>Custom Adapter Object</strong> : </p>
  
  <pre><code> import java.util.ArrayList;
      import org.apache.http.NameValuePair;
      import org.apache.http.message.BasicNameValuePair;
      import org.json.JSONArray;
      import org.json.JSONException;
      import org.json.JSONObject;
      import android.os.Bundle;
      import android.os.StrictMode;
      import android.app.Activity;
      import android.content.Intent;
      import android.content.res.Resources;
      import android.util.Log;
      import android.view.Menu;
      import android.widget.ListView;
      import android.widget.TextView;
  
  public class MainActivity extends Activity {
  
      ListView list;
      JSONObject Jobj;
      TextView txt_Date;
      TextView txt_Location;
      String team_ID;
      CustomAdapter custAdpt;
      public  MainActivity main = null;
      ListModel model = new ListModel();
      public  ArrayList&lt;ListModel&gt; ListModelArr = new ArrayList&lt;ListModel&gt;();
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_custom_list_view_android_example);
          txt_Date = (TextView) findViewById(R.id.txt_date);
          txt_Location = (TextView) findViewById(R.id.txt_location);
          Intent intent = getIntent();
          txt_Date.setText(intent.getStringExtra("startTime"));
          txt_Location.setText(intent.getStringExtra("location"));
          team_ID = intent.getStringExtra("teamID");
          setListData();
          Resources res =getResources();
          list=(ListView)findViewById(R.id.participationList);
          MainActivity main = this;
          custAdpt = new CustomAdapter(main, ListModelArr, res);
          list.setAdapter(custAdpt);
  
  
  
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
  
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
      public void setListData(){
  
          StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
          .detectDiskReads().detectDiskWrites().detectNetwork()
          .penaltyLog().build());
  
          String response = null; // to accept Json String from php
          String memberName = null; // for member name to display in list
          String photo = null ; // for photo path
          int memberStatus = 0; // to check member status
          JSONArray memberData=null; // to retrieve member data from json response
  
  
           ArrayList&lt;NameValuePair&gt; postParameters = new ArrayList&lt;NameValuePair&gt;();
          postParameters.add(new BasicNameValuePair("teamID",team_ID));
          postParameters.add(new BasicNameValuePair("startTime","2013-09-18 10:00:00"));// parameter for php
  
  
          try {
  
              response = CustomHttpClient.executeHttpPost(
                         "http://10.0.2.2/football365/sankashaList.php",
                          postParameters);
  
              Jobj = new JSONObject(response);
              memberData=Jobj.getJSONArray("memberdata");
  
              for(int i = 0 ; i &lt; memberData.length(); i++){
  
                  memberName = (memberData.getJSONObject(i).getString("name").toString());
                  memberStatus = Integer.parseInt((memberData.getJSONObject(i).getString("memberStatus").toString()));
                  photo = (memberData.getJSONObject(i).getString("photo").toString());
                  model.setMemberName(memberName);
                  model.setMemberStatus(memberStatus);
                  model.setImage(photo);
                  ListModelArr.add(model);
              }
          }
          catch(JSONException e){
  
              Log.e("log_tag", "Error parsing data "+e.toString());
          }
          catch (Exception e) {
  
              Log.e("log_tag", "Error parsing data "+e.toString());
          }
  
  
      }
  
  }
  </code></pre>
  
  <p>This is where I define <strong>Getter</strong> &amp; <strong>Setter</strong> Methods </p>
  
  <pre><code> public class ListModel {
  
      private String imgMember;
      private String memberName;
      private int memberStatus;
  
      ///Setters
      public void setMemberName(String memberName)
      {
          this.memberName = memberName;
      }
  
      public void setImage(String imgMember)
      {
          this.imgMember = imgMember;
      }
  
  
      public void setMemberStatus(int memberStatus)
      {
          this.memberStatus=memberStatus;
      }
  
      ///Getters
  
      public String getMemberName()
      {
          return this.memberName;
      }
  
      public String getImage()
      {
          return this.imgMember;
      }
  
  
      public int getMemberStatus()
      {
          return this.memberStatus;
      }
  }
  </code></pre>