title: setListadapter and getListView() undefine on fragment
body: <p>I hope you can help me. I am new in android development and I already tried to research about this but I had no luck. I hope you can help me with my simple problem. </p>
  
  <p>How do I use setListAdapter on a fragment? My activity extends fragment and I can't convert it  to listfragment since I am displaying it inside one of my fragment tabs. </p>
  
  <pre><code>public class AccountFragment extends Fragment implements OnItemClickListener {
  private LoginDataBaseAdapter loginDataBaseAdapter;
  
  private RemindersDbAdapter mDbHelper;
  
  ListView listv;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
  
           mDbHelper = new RemindersDbAdapter(getActivity());
           mDbHelper.open();
           fillData();
  
       //registerForContextMenu(getListView());----- Not working too :(
  
        //intialize variables
  
  
          View rootView = inflater.inflate(R.layout.fragment_account, container, false);
  
  
  
  
              registerForContextMenu(getView());
              listv = (ListView) rootView.findViewById(R.id.remlist);
  
  
  
  
  
  
  
          return rootView;
  
  
           }
  
      @Override
      public void onActivityResult( int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          fillData();
  
  
      }
  
      private void fillData() {
          Cursor remindersCursor = mDbHelper.fetchAllReminders();
          getActivity().startManagingCursor(remindersCursor);
  
          // Create an array to specify the fields we want to display in the list (only TITLE)
          String[] from = new String[]{RemindersDbAdapter.KEY_TITLE};
  
          // and an array of the fields we want to bind those fields to (in this case just text1)
          int[] to = new int[]{R.id.text1};
  
          // Now create a simple cursor adapter and set it to display
          SimpleCursorAdapter reminders = 
                  new SimpleCursorAdapter(getActivity(), R.layout.reminder_row, remindersCursor, from, to);
          setListAdapter(reminders);
      }
  
  
      public boolean onCreateOptionsMenu(Menu menu) {
          super.getActivity().onCreateOptionsMenu(menu);
          MenuInflater mi = getActivity().getMenuInflater();
          mi.inflate(R.menu.list_menu, menu); 
          return true;
      }
  
  
      public boolean onMenuItemSelected(int featureId, MenuItem item) {
          switch(item.getItemId()) {
          case R.id.menu_insert: 
              createReminder();
              return true; 
          case R.id.menu_settings: 
              Intent i = new Intent(getActivity(), TaskPreferences.class); 
              startActivity(i); 
              return true;
          }
  
          return super.getActivity().onMenuItemSelected(featureId, item);
      }
  
      @Override
      public void onCreateContextMenu(ContextMenu menu, View v,
              ContextMenuInfo menuInfo) {
          super.onCreateContextMenu(menu, v, menuInfo);
          MenuInflater mi = getActivity().getMenuInflater(); 
          mi.inflate(R.menu.list_menu_item_longpress, menu); 
      }
  
      @Override
      public boolean onContextItemSelected(MenuItem item) {
          switch(item.getItemId()) {
          case R.id.menu_delete:
              AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
              mDbHelper.deleteReminder(info.id);
              fillData();
              return true;
          }
          return super.onContextItemSelected(item);
      }
  
      private void createReminder() {
          Intent i = new Intent(getActivity(), ReminderEditActivity.class);
          startActivityForResult(i, ACTIVITY_CREATE);
      }
  
      @Override
      public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
              long arg3) {
          // TODO Auto-generated method stub
  
      }
  
  
  
  
  
  
      }
  </code></pre>