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.

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.
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);
}
}
Yes you can do it.
1st way:
define an activity as Dialog with the below attribute in AndroidManifest.xml file:
2nd way:
You can inflate the XML layout inside the dialog as below:
for example:
edit: link fixed
Android Dialog with ListView.