01.
public
class
Fragment1
extends
Fragment {
02.
03.
String data;
04.
05.
public
Fragment1() {
06.
07.
}
08.
09.
10.
@Override
11.
public
View onCreateView(LayoutInflater inflater, ViewGroup container,
12.
Bundle savedInstanceState) {
13.
14.
View rootView=inflater.inflate(R.layout.fragment, container,
false
);
15.
TextView get = (TextView)getActivity().findViewById(R.id.textView25);
16.
17.
Bundle bundle=getArguments();
18.
if
(bundle!=
null
){
19.
data=bundle.getString(
"KEY"
);
20.
}
21.
Toast.makeText(getActivity(), data, Toast.LENGTH_SHORT).show();
22.
get.setText(data);
23.
return
rootView;
24.
25.
}
26.
}