title: How do i pass information from an activity to an edittext in a custom alertdialog
body: <p>I have made a custom alertdialog that has 2 Edittexts in it. I want to pass information to it from an existing database when clicking something.</p>
  
  <p><strong><em>this is the Custom alert dialog's class</em></strong></p>
  
  <pre><code>    @Override
      public Dialog onCreateDialog(Bundle savedInstanceState) {
          final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
  
          LayoutInflater inflater = getActivity().getLayoutInflater();
          View view = inflater.inflate(R.layout.add_job_dialouge, null);
  
          builder.setView(view).setTitle("Add Job")
  
                  .setPositiveButton("add", new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialogInterface, int i) {
  
                          if(isDouble(wageValue.getText().toString())){
                              String nameOjob = jobName.getText().toString();
                              Double valueOwage = Double.parseDouble(wageValue.getText().toString());
                              listener.applyTexts(nameOjob, valueOwage);
                              builder.create();
  
                          }else{
                              wageValue.setError("Wrong Format Error");
                          }
  
                      }
                  })
                  .setNeutralButton("cancel", new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialogInterface, int i) {
  
                      }
                  });
  
  
          jobName = view.findViewById(R.id.job_name_ETD);
          wageValue = view.findViewById(R.id.wage_ETD);
  
          //I want to pass information to these
  
          //jobName.setText();
          //wageValue.setText();
  
          return builder.create();
      }
  
      @Override
      public void onAttach(Context context) {
          super.onAttach(context);
  
          try {
              listener =(ExampleDialogueListener) context;
          } catch (ClassCastException e) {
              throw new ClassCastException(context.toString() + "must implement Example Dialogue Listener");
          }
      }
  
      public interface ExampleDialogueListener{
          void applyTexts(String jobname, Double wage);
      }
  
      boolean isDouble(String str) {
          try {
              Double.parseDouble(str);
              return true;
          } catch (NumberFormatException e) {
              return false;
          }
      }
  
  }
  </code></pre>
  
  <p>I want to pass info to the edittext through parameters, so that there's info  on the edit text when I create the alertdialog</p>