I'm trying to convert my entire ListFragment class into a Fragment class with a ListView added to it.

Call this class HomeworkListFragment. I changed the extension from ListFragment to Fragment:

As a result I have created the following:

```
public class HomeworkListFragment extends Fragment{

public static final String TAG = "HomeworkListFragment";

public ListView mListView;
public HomeworkAdapter mAdapter;

private ArrayList<HomeworkObject> mCrimes;

@Override
public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setHasOptionsMenu(true);

    getActivity().setTitle(R.string.homework_title);
    mCrimes = HomeworkLab.get(getActivity()).getHomework();

    mAdapter = new HomeworkAdapter(mCrimes);
    mListView.setAdapter(mAdapter);

    setRetainInstance(true);

}

@TargetApi(11)
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState){
    View v = super.onCreateView(inflater,parent,savedInstanceState);

    mListView = (ListView)v.findViewById(android.R.id.list);
    mListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);

    mListView.setMultiChoiceModeListener(new MultiChoiceModeListener(){
        @Override
        public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
            switch (item.getItemId()){
                case R.id.menu_item_delete_homework:
                    HomeworkLab homeworkLab = HomeworkLab.get(getActivity());
                    for (int i = mAdapter.getCount() - 1;i>=0;i--){
                        //if (mListView.getListView().isItemChecked(i)){
                            //homeworkLab.deleteHomework(mAdapter.getItem(i));
                        //}
                    }
                    mode.finish();
                    mAdapter.notifyDataSetChanged();
                    return true;
                default:
                    return false;
            }
        }

        @Override
        public boolean onCreateActionMode(ActionMode mode, Menu menu) {
            //ActionMode.callback Methods
            MenuInflater inflater = mode.getMenuInflater();
            inflater.inflate(R.menu.homework_list_item_context, menu);
            return true;
        }

        @Override
        public void onDestroyActionMode(ActionMode arg0) {
            //not used here
        }

        @Override
        public boolean onPrepareActionMode(ActionMode arg0, Menu arg1) {
            //not used here
            return false;
        }

        @Override
        public void onItemCheckedStateChanged(ActionMode arg0,
                int arg1, long arg2, boolean arg3) {
            //not used here
        }

    });
    mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position,
                long id) {
            HomeworkObject c = mAdapter.getItem(position);
            //Start CrimeActivity
            //Intent i = new Intent(getActivity(), CrimeActivity.class);
            Intent i = new Intent(getActivity(), HomeworkPagerActivity.class);
            i.putExtra(HomeworkFragment.EXTRA_HOMEWORK_ID, c.getId());
            startActivity(i);               
        }

    });     
    return v;
}

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){
    super.onCreateOptionsMenu(menu,inflater);
    inflater.inflate(R.menu.fragment_homework_list, menu);
}

@TargetApi(11)
@Override
public boolean onOptionsItemSelected(MenuItem item){
    switch(item.getItemId()){
        case R.id.menu_item_new_homework:
            HomeworkObject homework = new HomeworkObject();
            homework.setTitle("");
            HomeworkLab.get(getActivity()).addHomework(homework);
            Intent i = new Intent(getActivity(),HomeworkPagerActivity.class);
            i.putExtra(HomeworkFragment.EXTRA_HOMEWORK_ID, homework.getId());
            startActivityForResult(i,0);
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    getActivity().getMenuInflater().inflate(R.menu.homework_list_item_context, menu);
}

@Override
public boolean onContextItemSelected(MenuItem item) {
    AdapterContextMenuInfo info = (AdapterContextMenuInfo)item.getMenuInfo();
    int position = info.position;
    HomeworkObject h = mAdapter.getItem(position);

    switch (item.getItemId()) {
        case R.id.menu_item_delete_homework:
            HomeworkLab.get(getActivity()).deleteHomework(h);
            mAdapter.notifyDataSetChanged();
            return true;
    }
    return super.onContextItemSelected(item);
}

@Override
public void onResume() {
    super.onResume();
    mAdapter.notifyDataSetChanged();
    mCrimes = HomeworkLab.get(getActivity()).getHomework();//update list
}

@Override
public void onPause(){
    super.onPause();
    HomeworkLab.get(getActivity()).saveHomework();
}

/*@Override
public void onListItemClick(ListView l, View v, int position, long id){
    HomeworkObject c = ((HomeworkAdapter)getListAdapter()).getItem(position);
    //Start CrimeActivity
    //Intent i = new Intent(getActivity(), CrimeActivity.class);
    Intent i = new Intent(getActivity(), HomeworkPagerActivity.class);
    i.putExtra(HomeworkFragment.EXTRA_HOMEWORK_ID, c.getId());
    startActivity(i);
}*/

private class HomeworkAdapter extends ArrayAdapter<HomeworkObject>{
    public HomeworkAdapter(ArrayList<HomeworkObject> crimes){
        super(getActivity(), 0, crimes);
    }

    @SuppressLint("SimpleDateFormat")
    @Override
    public View getView(int position, View convertView, ViewGroup parent){
        if (convertView == null){
            convertView = getActivity().getLayoutInflater().inflate(R.layout.list_item_homework, null);
        }
        HomeworkObject c = getItem(position);

        TextView titleTextView = (TextView)convertView.findViewById(R.id.homework_list_item_titleTextView);
        titleTextView.setText(c.getTitle());
        TextView dateTextView = (TextView)convertView.findViewById(R.id.homework_list_item_dateTextView);

        DateFormat df = new SimpleDateFormat("EEEE, d MMMM yyyy");     
        String reportDate = df.format(c.getDate());
        dateTextView.setText(reportDate);
        //dateTextView.setText(c.getDate().toString());

        CheckBox solvedCheckBox = (CheckBox)convertView.findViewById(R.id.homework_list_item_solvedCheckBox);
        solvedCheckBox.setChecked(c.isSolved());

        return convertView;
    }
}

```

}

As far as I can tell there's an error in the onCreateView method with some null pointer error but I can't make heads or tails of this issue.

I recently picked up Android after moving from iOS so I'm pretty new to this. Any explanation could help a lot!