你的位置:首页 > 操作系统

[操作系统]Fragment之间传值


 

Activity:

     String myArguments;    public String getarguments() {   return myArguments;  }

    public void setarguments(String title) {   this.myArguments = title;  }     

 

http://www.cnblogs.com/xiaobo-Linux/ qq463431476

Afragment:

 

((MainActivity)getActivity()).setarguments("p");

 

Bfragment:

 String home = ((MainActivity)getActivity()).getarguments();