How to send data from an Activity to a Fragment?

0

1 I have a question a while ago. I want to pass a value from activity to fragment , however, from the error when opening fragment to be specific at the time of receiving this value, I believe.

That's how hedge:

estab = "academia";

        MapsFragment_Estab mapsFragment_estab = new MapsFragment_Estab();
        Bundle academia = new Bundle();
        academia.putString("CoordAcademy", estab);
        mapsFragment_estab.setArguments(academia);

And that's how I get in fragment :

String CoordAcademy = getArguments().getString("CoordAcademy");

[]

    
asked by anonymous 12.09.2017 / 21:46

0 answers