0
I need to create a listview inside a dialog, using the data of the Sqlite database, but in each of the data that will load has to have an Edittext in front, for example.
Product Quantity Adubo Edittext
0
I need to create a listview inside a dialog, using the data of the Sqlite database, but in each of the data that will load has to have an Edittext in front, for example.
Product Quantity Adubo Edittext
1
After creating your list normally (data and Adapter), just insert them into the dialog. Something like:
public class MyDialog extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
View view = LayoutInflater.from(getActivity()).inflate(R.layout.my_list, null, false);
// Listagem normal: recuperar ListView, dados do banco, criar adapter que terá seu próprio layout (com o EditText e os TextViews) para os dados
alertDialogBuilder.setTitle("Título")
.setMessage("Mensagem")
.setView(view);
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//TODO
}
})
.setNegativeButton("Cancelar", null);
return alertDialogBuilder.create();
}
}
Browser other questions tagged android listview dialog
You are not signed in. Login or sign up in order to post.
Andre, it worked, thank you !
– Alexwell Souza
Boa @Alexwellsouza !
– André Ozawa