I have a dialog in my preferences activity defined as follows (the layout is defined in xml):
public class DialogPreference extends android.preference.DialogPreference {
public DialogPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
public DialogPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public void onClick (DialogInterface dialog, int which) {
if (DialogInterface.BUTTON_POSITIVE == which) {
if (getKey() ==
getContext().getResources().getText(R.string.blabla)) {
// FIXME ??? - how ?
Log.v(TAG, "DialogPreference: onClick");
}
}
}
}
In the dialog there are several widgets, namely a RadioGroup and several RadioButtons. I currently am not able to find a way to access these widgets in the onClick method.
What is the way to access those widgets?
You can cast the
DialogInterfacetoAlertDialoglike so:(or something similar)