Android Open Source - android-child-lock Set Pin Dialog Fragment






From Project

Back to project page android-child-lock.

License

The source code is released under:

Apache License

If you think the Android project android-child-lock listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.alimuzaffar.android.childlock.fragments;
/*from w  ww  . ja v  a 2s. com*/
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;

public class SetPinDialogFragment extends DialogFragment{
    
  DialogInterface.OnClickListener onClickNo;
  DialogInterface.OnClickListener onClickYes;
  
    public static SetPinDialogFragment newInstance() {
        return new SetPinDialogFragment();
    }
    
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
        alertDialogBuilder.setTitle("Set PIN");
        alertDialogBuilder.setMessage("In order to use this feature you must set a 4-digit PIN?");
        //null should be your on click listener
        alertDialogBuilder.setPositiveButton("Yes", onClickYes);
        alertDialogBuilder.setNegativeButton("No", onClickNo);

        return alertDialogBuilder.create();
    }

  public void setOnClickNo(DialogInterface.OnClickListener onClickNo) {
    this.onClickNo = onClickNo;
  }

  public void setOnClickYes(DialogInterface.OnClickListener onClickYes) {
    this.onClickYes = onClickYes;
  }
    
  @Override
  public void onDestroyView() {
    if (getDialog() != null && getRetainInstance())
      getDialog().setOnDismissListener(null);
    super.onDestroyView();
  }
    
}




Java Source Code List

com.alimuzaffar.android.childlock.Constants.java
com.alimuzaffar.android.childlock.activities.LockScreenActivity.java
com.alimuzaffar.android.childlock.activities.ParentalControlActivity.java
com.alimuzaffar.android.childlock.adapters.EfficientAdapter.java
com.alimuzaffar.android.childlock.fragments.ListOfApplicationsFragment.java
com.alimuzaffar.android.childlock.fragments.ListOfLockedApplicationsFragment.java
com.alimuzaffar.android.childlock.fragments.SetPinDialogFragment.java
com.alimuzaffar.android.childlock.services.HeartBeat.java
com.alimuzaffar.android.childlock.utils.AppPrefs.java
com.alimuzaffar.android.childlock.utils.AppSettings.java
com.alimuzaffar.android.childlock.utils.Utils.java
model.AccessGranted.java