Code example for ListFragment

Methods: getListView

0
  } 
   
  @Override 
  public void onSaveInstanceState(Bundle state) {
    state.putInt(STATE_CHECKED,
                  getListView().getCheckedItemPosition());
  } 
   
  protected void restoreState(Bundle state) {
    if (state!=null) {
      int position=state.getInt(STATE_CHECKED, -1);
       
      if (position>-1) {
        getListView().setItemChecked(position, true);
      } 
    } 
  } 
   
  public void enablePersistentSelection() { 
    getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
Experience pair programming with AI  Get Codota for Java