title: Update private ListFragment from parent activity
body: <p>I have a <code>FragmentActivity</code> which creates a <code>ListFragment</code>. Inside the <code>ListFragment</code> is a custom adapter. When I would try to make the adapter public, it wouldn't let me. So, I don't really have access to the adapter or I'm not sure how to get it. I add some data to the <code>listview</code> statically with a public arraylist of objects that I declare early in the lifecycle. However, other data I want to retrieve with <code>AsyncTask</code> from a Database. I get this data in the parent activity and I know right when it is finished fetching the data. So,
  Can I update the <code>listView</code> within the <code>ListFragment</code> with access to the <code>arraylist</code>, but not access to the adapter? If so, can I do it from the activity or do I need to somehow call a method in <code>listFragment</code>? If I need to call a method in <code>listFragment</code>, how do I access that method from the activity? If this is not possible without access to the adapter, how do I get access to the adapter without the public keyword? Would it be better to move my <code>AsycTask</code> to my <code>ListFragmen</code>t?</p>
  
  <p>I know it sounds like a lot, but I'm just wondering how to refresh the <code>listview</code> with those cicumstances. Help is greatly appreciated.</p>
  
  <p>Call to method:</p>
  
  <pre><code>ListFragment fragment = (ListFragment) getSupportFragmentManager().findFragmentByTag("fragtag");
                  fragment.updateData();
  </code></pre>
  
  <p>Method that refreshes:</p>
  
  <pre><code>public void updateData(){
      ((ArrayAdapter)this.getListAdapter()).notifyDataSetChanged();
  }
  </code></pre>
  
  <p>It is in my subclass of <code>ListFragment</code>, but not in any methods.</p>
  
  <p>**Edit:**Now I get the following error:</p>
  
  <p><code>Error parsing data java.lang.ClassCastException: com.dynamic_internet_solutions.scsinfo.app.SpeakerListFragment$1SpeakersListAdapter cannot be cast to android.widget.ArrayAdapter</code></p>
  
  <p>**Edit - Solved: ** I did </p>
  
  <pre><code>ListFragment fragment = (ListFragment) getSupportFragmentManager().findFragmentByTag("fragtag");
  BaseAdapter adapter = (BaseAdapter) fragment.getListAdapter();
  adapter.notifyDataSetChanged();
  </code></pre>
  
  <p>after I set the tag of my fragment on initialization.</p>