title: Android - EditText dosen't refresh in dialogfragment
body: <p>this is my last desperate attempt to fix this problem. </p>
  
  <p>i am using dialogfragment to make my dialog window MyDialog. the window is supposed to show a score I have sent with and the user can then write in their name and confirm. i am then supposed to be able to retrieve their name. </p>
  
  <p>My first problem is that the edittext that are supposed to show the score, doesn't want to show the score i set the edittext to be (it will only show new text if it was in the xml file). I can however still retrieve the correct score(text) afterwards from the same edittext.</p>
  
  <p>The second problem is that the text that the user writes in can't be retrieved since the edittext isn't updating. However the text that was in the field from the xml file can be retrieved. </p>
  
  <p>It seems like the edittext doesn't want to refresh after they are made in the xml file. </p>
  
  <p>the dialog class (imports taken out):</p>
  
  <pre><code>public class MyDialog extends DialogFragment 
  {
  private EditText scoreEdit;
  private EditText userEdit;
  
  private DialogClickListener callback;
  public interface DialogClickListener 
  {
      public void onFinishedClick();
  }
  @Override 
  public void onCreate(Bundle savedInstanceState)
  {    
          super.onCreate(savedInstanceState);
          try 
          {
              callback = (DialogClickListener) getActivity();
          }catch(ClassCastException e)
          {
              throw new ClassCastException("called class must implement interface");
          }
  }
  public static MyDialog newInstance(int title)
  {   
          MyDialog frag = new MyDialog(); 
          Bundle  args = new Bundle();    
          args.putInt("tittel",title);
          frag.setArguments(args);    
          return  frag;   
  }
  
  @Override
  public Dialog onCreateDialog(Bundle savedInstanceState)
  {
      AlertDialog.Builder dialog = new AlertDialog.Builder(getActivity());
  
      LayoutInflater inflater = getActivity().getLayoutInflater();
      View inflatedView = inflater.inflate(R.layout.dig_lay, null);
      scoreEdit = (EditText) inflatedView.findViewById(R.id.dialogScoreEdit);
      userEdit = (EditText) inflatedView.findViewById(R.id.dialogUsernameEdit);
  
      scoreEdit.setText("score supposed to change"); 
     // scoreEdit (edittext) is not changing 
  
      dialog.setView(inflater.inflate(R.layout.dig_lay, null));
      dialog.setTitle("Title");
      dialog.setPositiveButton("reg1", new DialogInterface.OnClickListener() 
      {
          @Override
          public void onClick(DialogInterface dialog, int whichButton) 
          {
              System.out.println("new text supposed to be: " + userEdit.getText().toString()); 
              //old text from xml shows 
              callback.onFinishedClick();
          }
      });
      setCancelable(false);
      return dialog.create(); 
  }
  }
  </code></pre>
  
  <p>the XML file for the dialog window:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/dialogLayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;LinearLayout 
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" 
      android:layout_marginTop="16dp"
      android:layout_marginLeft="4dp"
      android:layout_marginRight="4dp"
      android:layout_marginBottom="4dp"&gt;
  
         &lt;TextView
          android:text="score"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" /&gt;
        &lt;EditText 
          android:id="@+id/dialogScoreEdit"
          android:layout_weight="1"
          android:layout_width="0dp"
          android:layout_height="wrap_content" 
          android:hint="score here"
          android:inputType="none"/&gt;
      &lt;/LinearLayout&gt;
  
    &lt;LinearLayout 
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" 
      android:layout_marginTop="4dp"
      android:layout_marginLeft="4dp"
      android:layout_marginRight="4dp"
      android:layout_marginBottom="16dp"
      android:fontFamily="sans-serif"&gt;
  
        &lt;TextView
          android:text="Username"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"/&gt;
        &lt;EditText 
          android:id="@+id/dialogUsernameEdit"
          android:layout_weight="1"
          android:layout_width="0dp"
          android:layout_height="wrap_content" 
          android:text="retrive this"
          android:inputType="none"/&gt; 
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>picture of the dialogwindow: <a href="http://i.stack.imgur.com/EvwSe.png" rel="nofollow">http://i.stack.imgur.com/EvwSe.png</a></p>
  
  <p>I have tried calling onResume() and putting the new score in. but the edittext still doesn't change. </p>
  
  <p>I appreciate any answer and sorry for any bad English :)</p>