title: How to pass data to Dialog Fragment while It's showing
body: <p>It is defacto that when you need to pass an argument to a custom dialog fragment, you bundle it up before actually using them.</p>
  
  <p>Example: </p>
  
  <pre><code>class MyDFrag extends DialogFragment{
  
        //Empty Construct
        public MyDFrag(){}
  
        public static MyDFrag newInstance(){
  
            MyDFrag fragment = new MyDFrag();
            args = new Bundle();
            fragment.setArgument(args);
  
        }
  
  }
  </code></pre>
  
  <p>This works splendid for the most path but only if you pass this arguments before actually showing the dialog fragment.</p>
  
  <p>My problem is that i have a textview in my dialog and want to change its value when something happens in its parent activity while the dialog is currently showing.</p>
  
  <p>Passing the argument after showing the dialog doesn't effect this change.</p>
  
  <p>In my onCreate: </p>
  
  <pre><code>public void onViewCreated(View view, Bundle savedInstanceState) {
      super.onViewCreated(view, savedInstanceState);
  
      textbox = (TextView) view.findViewById(R.id.textish);
  
      if(args.containsKey("status")){
          textbox.setText(getArguments().getString("status"));
      }
  
  }
  </code></pre>
  
  <p>In the dialog class, i have a public dialog that set the value of the textview which i then call in my main activity at some point. </p>
  
  <pre><code>public void setStatus(String value){
      args.putString("status", value);
  }
  </code></pre>
  
  <p>So when i'm ready in my main activity, i call </p>
  
  <pre><code>dialog.setStatus("ok");
  </code></pre>
  
  <p>This only works if i run code before showing the dialog not whilst its showing. Is there a way to achieve this?</p>
  
  <p>Suggestion are appreciated, Thanks</p>