package com.spiddekauga.android.ui;

import android.content.Context;
import android.preference.DialogPreference;
import android.util.AttributeSet;

/**
 * A confirm dialog preference screen
 */
public class ConfirmDialogPreference extends DialogPreference {
private Listener mListener = null;

public ConfirmDialogPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
	super(context, attrs, defStyleAttr, defStyleRes);
}

public ConfirmDialogPreference(Context context, AttributeSet attrs, int defStyleAttr) {
	super(context, attrs, defStyleAttr);
}

public ConfirmDialogPreference(Context context, AttributeSet attrs) {
	super(context, attrs);
}

public ConfirmDialogPreference(Context context) {
	super(context);
}

/**
 * Set listener when the dialog is closed
 * @param listener listen to dialog events
 */
public void setListener(Listener listener) {
	mListener = listener;
}

//@Override
//protected void onDialogClosed(boolean positiveResult) {
//	super.onDialogClosed(positiveResult);
//	if (mListener != null) {
//		mListener.onDialogClosed(positiveResult);
//	}
//}

public interface Listener {
	/**
	 * Called when the dialog is closed
	 * @param positiveResult true if the user click the positive button
	 */
	void onDialogClosed(boolean positiveResult);
}
}

@@ -906,18 +906,16 @@
 ner;%0A%7D%0A%0A
-//
 @Overrid
@@ -916,18 +916,16 @@
 verride%0A
-//
 protecte
@@ -972,18 +972,16 @@
 sult) %7B%0A
-//
 %09super.o
@@ -1011,18 +1011,16 @@
 esult);%0A
-//
 %09if (mLi
@@ -1037,18 +1037,16 @@
 null) %7B%0A
-//
 %09%09mListe
@@ -1085,15 +1085,11 @@
 t);%0A
-//
 %09%7D%0A
-//
 %7D%0A%0Ap

Fix ConfirmDialogPreference: Now calls listener