I need to create a listview within a dialog, using the data from the SQLite database, but in each of the data it is going to load, you have to have an EditText in front, for example.
Product Quantity EditText Fertilizer
I need to create a listview within a dialog, using the data from the SQLite database, but in each of the data it is going to load, you have to have an EditText in front, for example.
Product Quantity EditText Fertilizer
After creating your listing normally (data and adapter), simply enter them in 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();
}
}