Example usage for android.widget NumberPicker getNumber

List of usage examples for android.widget NumberPicker getNumber

Introduction

In this page you can find the example usage for android.widget NumberPicker getNumber.

Prototype

public char getNumber() 

Source Link

Document

Gets the number or symbol associated with the key.

Usage

From source file:com.sbgapps.scoreit.numberpicker.NumberPickerDialogFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    final NumberPicker picker = (NumberPicker) inflater.inflate(R.layout.number_picker_dialog, null);
    ImageButton btn = picker.getSetButton();
    btn.setOnClickListener(new View.OnClickListener() {
        @Override/*  w  w w  .  java 2 s  . c o  m*/
        public void onClick(View view) {
            final Activity activity = getActivity();
            final Fragment fragment = getTargetFragment();
            if (activity instanceof NumberPickerDialogHandler) {
                final NumberPickerDialogHandler act = (NumberPickerDialogHandler) activity;
                act.onDialogNumberSet(mReference, picker.getNumber());
            } else if (fragment instanceof NumberPickerDialogHandler) {
                final NumberPickerDialogHandler frag = (NumberPickerDialogHandler) fragment;
                frag.onDialogNumberSet(mReference, picker.getNumber());
            }
            dismiss();
        }
    });

    return picker;
}