I have two Activities (A and B) and a Fragment F The Fragment F is contained in the Activity B I\'d like to send Strings from Activity A to Fragment F How can do that? Thanks!>
In Fragment.java file add the following code,
public static String name= null;
public void setName(String string){
name = string;
}
In MainActivity.java from which you want to send String add the following code,
String stringYouWantToSend;
Fragment fragment = new Fragment();
fragment.setName(stringYouWantToSend);