public void settingCount(MenuItem item) {
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
LayoutInflater layoutInflater = LayoutInflater.from(context);
View view = layoutInflater.inflate(R.layout.setting_dialog, null);
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
dialogBuilder.setView(view);
final EditText editTextString = (EditText) view.findViewById(R.id.editTextDialogString};
dialogBuilder
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
///.....///
})
.setNegativeButton("Отмена",
new DialogInterface.OnClickListener(){
///.....////
});
AlertDialog alertDialog = dialogBuilder.create();
alertDialog.show();
return true;
}
});
}
<item
...
android:onClick="settingCount" />
public void settingCount(MenuItem item) {
LayoutInflater layoutInflater = LayoutInflater.from(context);
View view = layoutInflater.inflate(R.layout.setting_dialog, null);
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
dialogBuilder.setView(view);
final EditText editTextString = (EditText) view.findViewById(R.id.editTextDialogString};
dialogBuilder
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
///.....///
})
.setNegativeButton("Отмена",
new DialogInterface.OnClickListener(){
///.....////
});
AlertDialog alertDialog = dialogBuilder.create();
alertDialog.show();
}