Back to project page RateMyApp.
The source code is released under:
MIT License
If you think the Android project RateMyApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.mariosangiorgio.ratemyapp.dialogs; //w w w. j a v a 2s . co m import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; import android.os.Bundle; import android.util.Log; import com.mariosangiorgio.ratemyapp.listeners.DialogClickListener; public abstract class AbstractDialogFragment extends DialogFragment implements DialogInterface.OnClickListener{ private DialogClickListener actualListener; @Override abstract public Dialog onCreateDialog(Bundle savedInstanceState); public void setActualListener(DialogClickListener actualListener){ this.actualListener = actualListener; } @Override public void onCreate(Bundle icicle) { this.setCancelable(true); setRetainInstance(true); super.onCreate(icicle); } @Override public void onDestroyView() { if (getDialog() != null && getRetainInstance()) getDialog().setDismissMessage(null); super.onDestroyView(); } @Override public void onClick(DialogInterface dialog, int buttonPressed) { if(actualListener != null && getActivity() != null && getFragmentManager() != null){ actualListener.onClick(dialog, buttonPressed, getActivity(), getFragmentManager()); } else{ Log.e("RateMyApp", "No actual listener registered for "+dialog); } } }