Возможно ли иметь собственный ListView
внутри класса Fragment
?
Это мой класс фрагментов, в котором fragment_find_people
— это просто пустой XML
:
public class FindPeopleFragment extends Fragment {
public FindPeopleFragment(){}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_find_people, container, false);
return rootView;
}
}
У меня уже есть customListView
, но он работает только с классом Activity
. Как я могу передать это Fragment
?
мой listview_main xml
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/listmain" >
<ListView
android:id="@+id/listview"
android:layout_marginTop="10dp"
android:background="@drawable/bg"
android:divider="#9c9c9c"
android:dividerHeight="5dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent" /></RelativeLayout>