Code example for ListFragment

Methods: getListAdaptersetListAdapter, getActivity, onActivityCreated

0
  public final static int ACTION_BAR_COLOR  = 0xFF3F9FE0;
  private static final String TAG           = "AuditionsFragment";
   
  @Override 
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    reloadAuditions(); 
  } 
 
  protected void reloadAuditions() { 
    Log.i(TAG, "Reloading auditions.");
    ArrayList<Audition> auditions = null;
    try { 
      auditions = AppDelegate.shared().getDBHelper().getOrderedAuditions();
    } catch (SQLException e) {
       
    } 
     
    if (auditions == null || auditions.size() == 0) {
       
    } else { 
      if (getListAdapter() == null) {
        auditionsArrayAdapter   = new AuditionsArrayAdapter(this.getActivity(), auditions);
        setListAdapter(auditionsArrayAdapter);
      } else { 
        auditionsArrayAdapter.setAuditions(auditions);
      } 
    } 
  } 
Contextual code suggestions in your IDE  Get Codota for Java