I have implemented custom listview.Now the user refreshes the app from another activity which causes the database to be updated.So, now the user comes back to the activity which has custom listview.now the issue is the listview is not updated to new data set.To fix this i call oncreate in onresume in my activity which has the custom listview associated with it. But doing this causes the items in the listview to duplicate itself(means it increase the number of items and repeats itself for every refresh call). Please help!
http://developer.android.com/training/basics/activity-lifecycle/starting.html
When activity starts, onCreate(), onStart(), onResume() methods are called in sequence one by one, if you call onCreate() in onResume(), that means you are going to fill the list twice.
You can make a method such as fillList() and call it only in onResume() state, in that way, whenever your activity resumes or creates, this method will be called, But make sure that this operation is not heavy. According to android, activity starts being visible to user onStart() but after onResume() user can interact.