I use the code below to create a custom preference. The xml layout file has a Button
, EditText
and TextView
. This custom layout appears inside an Alert
with "OK" and "Cancel" buttons. This all works well.
I would like to add a third button (a neutral button) beside the "OK and "Cancel" buttons. I've experimented with the AlertBuilder
class but can't figure out how to incorporate both my custom xml layout and a neutral button.
How can this be done?
Currently have...
public class MelsMessage extends DialogPreference {
Button bMessage;
EditText eMessage;
TextView tMessage;
public MelsMessage(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
protected View onCreateDialogView() {
LayoutInflater layoutInflater = LayoutInflater.from(getContext());
View view = layoutInflater.inflate(R.layout.dialog_pref_mess, null);
//UI elements
bMessage = (Button) view.findViewById(R.id.buttonMessage);
eMessage = (EditText) view.findViewById(R.id.edittextMessage);
tMessage = (TextView) view.findViewById(R.id.textviewMessage);
return view;
}
}