title: How to use Listadaptor class with Popupwindow\popupview
body: <p>I am using Listadaptor class for genrating a view in side the list which is working fine. same thing i want to use on a popup window but it throws the null pointer exception
  here is my code where i am calling the listadaptor class</p>
  
  <pre><code>private void showListPopUp() 
  {
      try
      {
          LayoutInflater layoutInflater = (LayoutInflater)getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
  
          View popupView = layoutInflater.inflate(R.layout.popuptktlist, null);
          final PopupWindow popupWindow = new PopupWindow(popupView,android.view.ViewGroup.LayoutParams.WRAP_CONTENT,android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
  
          lvTktList = (ListView) findViewById(R.id.listView_trbl_tkt_list);
          tvTicketNo  = (TextView)popupView.findViewById(R.id.tv_tktlist_ct);
          tvCallNat  = (TextView)popupView.findViewById(R.id.tv_tktlist_cn);
          tvCustGet  = (TextView)popupView.findViewById(R.id.tv_tktlist_custn);
          tvCityGet  = (TextView)popupView.findViewById(R.id.tv_tktlist_city);
          tvProbGet  = (TextView)popupView.findViewById(R.id.tv_tktlist_prob);
          popupWindow.showAtLocation(popupView, Gravity.CENTER, 10,10);
  
          lvTktList.setAdapter( new TicketListAdapter(getBaseContext(), getRecordDetailFromDB() ) );
      }
      catch(Exception ex)
      {
          Toast.makeText(getBaseContext(), ex.toString(), Toast.LENGTH_LONG).show();
      }
  }
  </code></pre>
  
  <p>here is my Listadaptor class</p>
  
  <pre><code>package lipicrm.atmcrm;
  
  import java.util.ArrayList;
  
  import android.content.Context;
  import android.graphics.Color;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ImageView;
  import android.widget.TextView;
  import android.widget.Toast;
  
  public class TicketListAdapter extends android.widget.BaseAdapter
  {
  public static ArrayList&lt;TktList&gt; tktList = null;
  private LayoutInflater inflater = null;
  Context context = null;
  
  public TicketListAdapter(Context context, ArrayList&lt;TktList&gt; tsList) 
  {
     this.context = context;
     tktList = tsList;
     inflater = LayoutInflater.from(this.context);
  }
  
  @Override
  public int getCount() 
  {
      return tktList.size();
  }
  
  @Override
  public Object getItem(int position) 
  {
      return tktList.get( position );
  }
  
  
  @Override
  public long getItemId(int position) 
  {
      return position;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup arg2) 
  {
  //      Toast.makeText(context, "44", Toast.LENGTH_LONG).show();
      try
      {
        ViewHolder holder;
        if (convertView == null) 
        {
            convertView = inflater.inflate(R.layout.popuptktlist_recorddtl,null);
            holder = new ViewHolder();
            holder.txt_CallTicket     = (TextView) convertView.findViewById(R.id.tv_tktlist_ct);
            holder.txt_CallNature     = (TextView) convertView.findViewById(R.id.tv_tktlist_cn);
            holder.txt_CustName       = (TextView) convertView.findViewById(R.id.tv_tktlist_custn);
            holder.txt_CityName       = (TextView) convertView.findViewById(R.id.tv_tktlist_city);
            holder.txt_Prob       = (TextView) convertView.findViewById(R.id.tv_tktlist_prob);
  
            convertView.setTag(holder);
        } 
        else 
        {
            holder = (ViewHolder) convertView.getTag();
        }
        holder.txt_CallTicket.setText(tktList.get(position).getCallTNo());
        holder.txt_CallNature.setText(tktList.get(position).getCallNature());
        holder.txt_CustName.setText(tktList.get(position).getAbrVtn());
        holder.txt_CityName.setText(tktList.get(position).getCityName());
        holder.txt_Prob.setText(tktList.get(position).getProbDesc());
  
      }
      catch(Exception ex)
      {
          Toast.makeText(context, ex.toString(), Toast.LENGTH_LONG).show();
      }
      return convertView;
  }
  
  static class ViewHolder 
  {
      TextView txt_CallTicket;
      TextView txt_CustName;
      TextView txt_CityName;
      TextView txt_CallNature;
      TextView txt_Prob;
  }
  }
  </code></pre>
  
  <p>list is genrating if i am using the code without popwindow</p>