title: Show list view in a popup window - Android
body: <p>I'm working on a project in Android and I have a problem.
  I have an activity which includes three buttons, edit text and a list view.</p>
  
  <p><img src="https://i.stack.imgur.com/O71FT.png" alt="enter image description here"></p>
  
  <p>I want to change that implementation and to show the list view on a new popup window only when the user press the select all button.
  I've added my code, thanks. </p>
  
  <pre><code>public class Notepadv1 extends ListActivity implements OnClickListener {
  
      private WordsDbAdapter mDbHelper;
      private Button selectAllButton;
          private PopupWindow mPopup;
  
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          selectAllButton = (Button)findViewById(R.id.selectAll);
          selectAllButton.setOnClickListener(this);
  
          mDbHelper = new WordsDbAdapter(this);
          mDbHelper.open();
          fillData();
      }
  
      public void onClick(View v) {
          switch(v.getId()){
              case(R.id.selectAll):
                  selectAll();
                  break;
          }
      }
  
      private void selectAll(){
      }
  
      private void fillData() {
  
          Cursor c = mDbHelper.fetchAllNotes();
          startManagingCursor(c);
  
          String[] from = new String[] { WordsDbAdapter.KEY_WORD };
          int[] to = new int[] { R.id.text1 };
  
  
          SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.words_row, c, from, to);
          setListAdapter(notes);
      }
  
  }
  </code></pre>