package com.bwie.fragmentcallback;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
/**
* Created by Shadow on 2017/7/11.
*/
public class Fragment02
extends Fragment {
private View
view;
@Override
public void onAttach(Context context) {
super.onAttach(context);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
view = inflater.inflate(R.layout.
fragment2, container,
false);
return view;
}
@Override
public void onActivityCreated(
@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}
public void setText(String s){
TextView fragment2_tv = (TextView)
view.findViewById(R.id.
fragment2_tv);
fragment2_tv.setText(s);
}
}