I have a WebView where the url can be added to favorites and display it in a listview. How do I notify favorite intent that a new favorite is added or removed from another intent with webview.
I am aware that开发者_JAVA百科 notifyDataSetChanged() to refresh a litstview. my problem is how do i know that I need to refresh.
Thanks in advance
When you have your listview in a separate activity, you don't need to refresh your list by calling notifyDataSetChanged. I recommend to update the list when the activity is started.
If you have the webview and the list in the same activity, you need to call notifyDataSetChanged() right after you have saved the new favorite.
精彩评论