Code example for DialogFragment

Methods: getActivity, startActivity

0
    } 
 
    @Override 
    public void onClick(DialogInterface dialogInterface, int i)
    { 
        if (SignalHelpers.userConsent(getActivity().getPreferences(Context.MODE_PRIVATE))) {
            startActivity(SignalHelpers.getAdditionalSettings());
        } 
    } 
 
    @Override 
    public void onShow(DialogInterface dialog)
    { 
        ((AlertDialog)this.getDialog()).getButton(DialogInterface.BUTTON_POSITIVE).setEnabled(false);
    } 
 
    @Override 
    public void onDismiss(DialogInterface unused)
    { 
        super.onDismiss(unused);
    }