This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public LogoutDialogFragment() {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onAttach(Activity activity) { | |
super.onAttach(activity); | |
if (activity instanceof LogoutDialogListener) { | |
listener = (LogoutDialogListener) activity; | |
} else { | |
throw new RuntimeException("The Activity must " + | |
"implement the LogoutDialogListener interface!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LogoutDialogFragment extends DialogFragment implements | |
OnClickListener { | |
// Used to communicate the result back to the Activity | |
private LogoutDialogListener listener; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Interface for Activities to implement to receive the result | |
*/ | |
public interface LogoutDialogListener { | |
public void performLogout(); | |
public void cancelLogout(); | |
} |
NewerOlder