Activity与Fragment实现简单传值
public StringvoiceString;
//从上一个界面传过来的数据
voiceString = getIntent().getExtras().getString("voiceString");
Log.e("monkey" +voiceString);
public String getVoiceString() {
return voiceString
};
Fragment接收从Activity中传来的数据
private StringvoiceString;
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
voiceString = ((MasuoActivity) activity).getVoiceString()
};