EditTextPreference를 확장하여 클릭 핸들러를 제어 할 수 있습니다. 대신 <EditTextPreference/>
의 XML로
package myPackage;
public class CustomEditTextPreference extends EditTextPreference {
public CustomEditTextPreference(Context context) {
super(context);
}
public CustomEditTextPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomEditTextPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public void onClick(DialogInterface dialog, int which) {
if (which == DialogInterface.BUTTON_POSITIVE) {
// add Handler here
}
super.onClick(dialog, which);
}
}
은 다음과 같이이를 참조 :
<myPackage.CustomEditTextPreference android:dialogTitle="Registration Key" android:key="challengeKey" android:title="Registration Key" android:summary="Click here to enter the registration key you received by email."/>
그것은 사용자 정의 EditTextPreference를 작성이 가능합니다. 이것 좀 봐 : http://stackoverflow.com/a/15219411/2107118 – appsroxcom