1.Fragment中通过getActivity()然后进行强制转化,调用Activity中的公有方法
---------------------------------------------------------------------------
2.
Bundle data = new Bundle();
data.putString("TEXT", "传递给fragment2");
fragment2.setArguments(data);
Fragment接收
Bundle data = getArguments();//获得从activity中传递过来的值
if(data!=null){
log.i("1","wwww"+data.getString("TEXT"));
}
转载请注明原文地址: https://ju.6miu.com/read-1000031.html