Code example for ListFragment

Methods: getActivity, getResources, onActivityCreated, setListAdapter

0
 */ 
public class ItemListFragment extends ListFragment {
    //private ArrayList<String> 
 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
 
        Configuration configuration = getResources().getConfiguration();
 
        setListAdapter(new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, new String[]{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O"}  ));
    } 
 
    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle b)
    { 
        Log.d("ItemListFragment", "onCreateView");
 
        View view = inflater.inflate(R.layout.item_list_fragment, container, false);
 
        return view;
    }