Myadapter.notifyDataSetChanged() throwing error
<p>I am trying to refresh the adapter as well as my list . But i have little confusion regarding where to place the method    Myadapter.notifyDataSetChanged() and list.clear(), So that they will work for me... can any one please edit my code and help me to come out from it..  Here Is my code</p>

<p>@Override</p>

<pre><code>protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    calendars = Uri.parse("content://com.android.calendar/events");
    managedCursor = getContentResolver().query(calendars, null, null, null, null);
    if(managedCursor.getCount()==0){
        Toast.makeText(getBaseContext(), "There Is No Event To Show", Toast.LENGTH_SHORT).show();
        Intent i=new Intent(DisplayEventActivity.this,EventCalendarActivity.class);
        startActivity(i);
        finish();

    }else{
    setContentView(R.layout.displayevent);
    id=getIntent().getExtras().getLong("ID");
    event_ListView=(ListView)findViewById(R.id.eventList);
    event_ListView.setOnItemClickListener(this);

    }
}

@Override
protected void onResume() {
    // TODO Auto-generated method stub
    super.onResume();
    model.getEventTitleList().clear();  
    myadapter.notifyDataSetChanged();
    event_ListView.setAdapter(myadapter);

    if(id==9){
        model=new MyEventModel(managedCursor);
        myadapter=new MyListAdapter(getApplicationContext(), model.getEventTitleList());
        event_ListView.setAdapter(myadapter);

    }else if(id==10){
        model=new MyEventModel(managedCursor);
        myadapter=new MyListAdapter(getApplicationContext(), model.getEventTitleList());
        event_ListView.setAdapter(myadapter);
    }

}


public void onItemClick(AdapterView&lt;?&gt; arg0, View view, int position, long arg3) {
    event_Id=model.getEventId();
    System.out.println("Event id from disp="+event_Id);
    Intent i=new Intent(DisplayEventActivity.this,UpdateEvent.class);
    i.putExtra("EventId", event_Id);
    startActivity(i);
    }
}
</code></pre>
