//code of AlertDialog
final AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
alert.setTitle(R.string.modification);
persoFomulair=new ListView(getActivity());
List<HashMap<Boolean,HashMap<String,String>>>list = prepareList(p);
MyListAdapter2 myListAdapter2 = new MyListAdapter2(getActivity(), R.layout.perso_list, list);
persoFomulair.setAdapter(myListAdapter2);
alert.setView(persoFomulair);
alert.setPositiveButton(R.string.valider, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
//What ever you want to do with the value
getValueOfItem();
ModifierPerso modifierPerso = new ModifierPerso();
modifierPerso.execute(type, String.valueOf(p.getId()), date_embauch, salair_journ);
}
});
alert.setNegativeButton(R.string.annuler, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// what ever you want to do with No option.
}
});
AlertDialog …Run Code Online (Sandbox Code Playgroud)keyboard android listview android-edittext android-alertdialog