I\'m new to Android app programming.
I have two Fragments - fragmentA.xml
and fragmentB.xml
.
In fragmentA
there are tw
Create a Global
class in your project and define a public string ..
public class Global{
public static String TEXT = "";
}
In your Fragment A
change this TEXT
on button click event..
but1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Global.TEXT = "string 1";
}
});
but2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Global.TEXT = "string 2";
}
});
same as on other button if you have
In your FragmentB
just setText()
....it will take lase value change to Text
text.setText(Global.TEXT);