I'm trying to use the listview with sectionheaders as mentioned here: Android ListView headers
The values are populated dynamically as shown below:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(TAG, "onActivityResult called");
if((requestCode == 1)&&(resultCode == Activity.RESULT_OK)){
if(data!= null){
AddedTask=data.getStringExtra("NewTask");
CategoryName=data.getStringExtra("CategoryItem");
TaskTime=data.getStringExtra("TaskTime");
List<Item> items = new ArrayList<Item>();
items.add(new Header(CategoryName));
items.add(new ListItem(AddedTask, TaskTime));
TwoTextArrayAdapter adapter = new TwoTextArrayAdapter(getActivity(), items);
listViewData.setAdapter(adapter);
adapter.notifyDataSetChanged();
}
}
}
My Problem is when I add the values first time its adding perfect. But when I get the values second time the values are simply updating with the previous values and not showing me the first added values.