How to Pass Value In Activity to Dialog and Display it in Android Studio : <p>Hello i have an Activity that i want to pass values from it to a Dialog and Display That value in a Dialog Textview.
The following is the activity that contains EditText that i want to pass to the Dialog.</p>

<p>p.java.</p>

<pre><code>public class piku_daily extends AppCompatActivity {
private LayoutInflater inflater;
String total = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_piku_daily);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
    public void Onclick(View v){
    Button button = (Button)v;
    String str = button.getText().toString();
    total+=str;

    EditText edit = (EditText)findViewById(R.id.piku_weka);
    edit.setText(total);
}
public void Onclear(View v){
    EditText edit = (EditText)findViewById(R.id.piku_weka);
    total="";
    edit.setText("");
}
public void Onplay(View v){
Mydialog dialog = new Mydialog();
dialog.show(getFragmentManager(), "Confirmation_Dialog");
}}
</code></pre>

<p>The Dialog codes are</p>

<pre><code>public class Mydialog extends DialogFragment {
LayoutInflater inflater;
View v;

@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState){

    inflater = getActivity().getLayoutInflater();
    v = inflater.inflate(R.layout.pikupop, null);
    TextView textview = (TextView) v.findViewById(R.id.piku_value);
    textview.setText(""+700);



    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

    builder.setView(v).setPositiveButton("Ndio", new DialogInterface.OnClickListener() {              
        @Override
        public void onClick(DialogInterface dialog, int which) {


        }
    }).setNegativeButton("Hapana", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            dialog.cancel();

        }
    });

    return builder.create();

}}
</code></pre>

<p>Can i please get an help on how i can do that</p>
