title: Help with creating a dialog and passing info to it
body: <p>I have created a screen with 5 rows of information. each row has 2 values. (<code>value1</code> and <code>value2</code>)
  At the end of each row is a button. For each row I have created a xml file that I am looping though and filling in the values from a database</p>
  
  <p>what I am looking at doing is when the button is pressed a dialog is opened with two editviews filled in with the values from that row</p>
  
  <p>Then when the button is pressed on the dialog the values are updated in database.</p>
  
  <p>I am having problems with the <code>createdialog</code> / <code>preparedialog</code> methods and passing the values to them.</p>
  
  <p>UPDATE with Code</p>
  
  <pre><code>public void createLayout(LinearLayout pMainlayout, String pMajorValue) {
  
          DatabaseTools db = new DatabaseTools(this);
  
          majorValue= pMajorValue;
  
          nameInfo = db.getNames(pMajorValue);
          name = returnName(pMajorValue);
  
          LayoutInflater  inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
          for (int i = 0; i &lt; nameInfo.size(); i++) {
              // Get views
              View view = (View) inflater.inflate(R.layout.mainlayout, null);
              TextView nameView = (TextView) sightmarkView.findViewById(R.id.name_title);
              TextView Value1View = (TextView) sightmarkView.findViewById(R.id.value1);
              TextView ValueView = (TextView) sightmarkView.findViewById(R.id.value2);
  
              Button updateButton = (Button) sightmarkView.findViewById(R.id.updatebutton);
  
          // Get info from Database
              nameValue = nameInfo.get(i).toString();
              value1v = db.getMark(majorValue,  nameInfo.get(i).toString());
                  value2v = db.getMark(majorValue,  nameInfo.get(i).toString());
              // populate info into fields
              nameView.setText(nameValue);
              Value1View.setText(String.valueOf(value1));
              Value2View.setText(String.valueOf(value2));
  
              updateButton.setOnClickListener(new View.OnClickListener() {
                          public void onClick(View v) {
              Bundle bundle = new Bundle();
                              //Code here to add values to a bundle
  
                              showDialog(SIGHTMARK_DIALOG_ID, bundle);
  
                          }
                      });
  
              pMainlayout.addView(view);
          }
  
      }
  </code></pre>
  
  <p>All this work correctly. The values are displayed. I have looked into using a bundle to pass them into the dialog</p>
  
  <pre><code>@Override
      protected Dialog onCreateDialog(int id, Bundle bundle) {
          switch(id) {
          case DIALOG_ID:
              LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              final View layout = inflater.inflate(R.layout.update, (ViewGroup) findViewById(R.id.update));
              final EditText value1Edit = (EditText) layout.findViewById(R.id.value1_current);
              final EditText value2Edit = (EditText) layout.findViewById(R.id.value2_current);
  
          //next pull values from bundle to populate into fields  
  
              AlertDialog.Builder builder = new AlertDialog.Builder(this);
              builder.setView(layout);
              // Now configure the AlertDialog
              builder.setTitle(R.string.sight_update_title);
              builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int whichButton) {
                      this.removeDialog(DIALOG_ID);
                  }
              });
              builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int which) {
  
                      value1New = Float.parseFloat(value1Edit.getText().toString());
                      value2New = Float.parseFloat(value2Edit.getText().toString());
  
                  // method run to update the database with the new values passed to it
                      updateMarks(value1, value2);
  
                      this.removeDialog(DIALOG_ID);
                  }
              });
              // Create the AlertDialog and return it
              AlertDialog Dialog = builder.create();
              return Dialog;
          }
          return null;
      }
  </code></pre>
  
  <p>This part has issues and is not getting the values correctly or passing them to the update method</p>