title: get values from AlterDialog from 2 numberpickers and edittext
body: <p>I want to make timer with 2 numberpickers to choose the start time by the user and editText to enter the timer name. I have used custom AlterDialog for this. 
  What I have problem with is to pass numberpickers results and name entered by the user back to MainActivity fields. 
  I should appreciate your support as I try to learn coding by my own.
  This is MyDialog.java which opens from MainActivity.</p>
  
  <pre><code>LayoutInflater inflater;
  View v;
  NumberPicker hourPicker;
  NumberPicker minPicker;
  EditText enterdish; 
  TextView yourdishname;
  
  @Override
  @NonNull
  public Dialog onCreateDialog(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      inflater = getActivity().getLayoutInflater();
      v=inflater.inflate(R.layout.activity_dialog, null);
  
      AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
      builder.setView(v);
  
          hourPicker = (NumberPicker) v.findViewById(R.id.picker1_hours);
          hourPicker.setMaxValue(36);
          hourPicker.setMinValue(0);
          hourPicker.setWrapSelectorWheel(false);
          hourPicker.setOnValueChangedListener( new NumberPicker.
                  OnValueChangeListener() {
                  @Override
                  public void onValueChange(NumberPicker picker, int
                      oldVal, int newVal) {
  
       }
            });
  hourPicker.setFormatter(new NumberPicker.Formatter() {
                @Override
                public String format(int i) {
                     return String.format("%02d", i);
               }
             });
  
  minPicker = (NumberPicker) v.findViewById(R.id.picker2_minutes);
  minPicker .setMaxValue(59);
  minPicker .setMinValue(1);
  minPicker .setWrapSelectorWheel(false);
  minPicker .setOnValueChangedListener( new NumberPicker.
          OnValueChangeListener() {
          @Override
          public void onValueChange(NumberPicker picker, int
              oldVal, int newVal) {
  
          }
    });
  minPicker.setFormatter(new NumberPicker.Formatter() {
        @Override
        public String format(int i) {
             return String.format("%02d", i);
       }
     });
  
      builder.setView(v).setPositiveButton("OK", new OnClickListener() {
  
          @Override
          public void onClick(DialogInterface dialog, int which) {
  
      enterdish = (EditText) v.findViewById(R.id.editText1_dishname);
      yourdishname = (TextView)v.findViewById(R.id.textView1_dishnamemain);
              yourdishname.setText(enterdish.getText());
          }
      }).setNegativeButton("Cancel", new OnClickListener() {
  
          @Override
          public void onClick(DialogInterface dialog, int which) {
              // TODO Auto-generated method stub
  
          }
      });
  
      return builder.create();
  }
  
  }
  </code></pre>