I want to pass complete listView
of fragment
B into fragment
C when i click on Send Button which is placed in fragment
B.
for this what i should have to do
here is my code of class B:
public class B extends Fragment {
Button send;
String[] list = { "A", "B", "C", "D", "E", "F", "G",
"H", "I ", "J ", "K", "L", "M", "N", "O",
"P" };
ArrayList<String> mList;
ListView LV;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View V = inflater.inflate(R.layout.b, container, false);
LV = (ListView) V.findViewById(R.id.listView);
send = (Button) V.findViewById(R.id.send);
mList = new ArrayList<String>();
for (int i = 0; i < list.length; i++) {
mList.add(list[i]);
}
ArrayAdapter<String> aa = new ArrayAdapter<String>(getActivity()
.getBaseContext(), android.R.layout.simple_list_item_1, mList);
LV.setAdapter(aa);
return V;
}
}
and class C::
public class C extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.c, container, false);
return rootView;
}
}