title: ListView in a pop up window
body: <p>I am making an application and using a custom adapter for ListView. It is working in the activity </p>
  
  <pre><code>public class Adapter extends ArrayAdapter {
      Context mContext;
      int resourceID;
      ArrayList&lt;String&gt; names;
      public Adapter(Context context, int resource, ArrayList&lt;String&gt; objects) {
          super(context, resource, objects);
          this.mContext = context;
          this.resourceID=resource;
          this.names= objects;
      }
  
      @Override
      public String getItem(int position) {
          return names.get(position);
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          View row = convertView;
          LayoutInflater inflater = LayoutInflater.from(mContext);
          row = inflater.inflate(resourceID, parent, false);
  
          TextView text = (TextView) row.findViewById(R.id.text);
  
          text.setText(names.get(position));
          return row;
      }
  
  }
  </code></pre>
  
  <p>I used this code to make them appear on an activity </p>
  
  <pre><code>    myNames= (ListView) findViewById(R.id.List);
      adapter = new Adapter(this,R.layout.names_view, Current.Names);
      myNames.setAdapter(adapter);
  </code></pre>
  
  <p>now I want to click on a button to make the same list appear on a popup, any help?</p>