{"action":"created","issue":{"url":"https://api.github.com/repos/h6ah4i/android-advancedrecyclerview/issues/232","repository_url":"https://api.github.com/repos/h6ah4i/android-advancedrecyclerview","labels_url":"https://api.github.com/repos/h6ah4i/android-advancedrecyclerview/issues/232/labels{/name}","comments_url":"https://api.github.com/repos/h6ah4i/android-advancedrecyclerview/issues/232/comments","events_url":"https://api.github.com/repos/h6ah4i/android-advancedrecyclerview/issues/232/events","html_url":"https://github.com/h6ah4i/android-advancedrecyclerview/issues/232","id":149732048,"number":232,"title":"NotifyDataSetChanged caused recycleview to blink","user":{"login":"taingmeng","id":7765045,"avatar_url":"https://avatars.githubusercontent.com/u/7765045?v=3","gravatar_id":"","url":"https://api.github.com/users/taingmeng","html_url":"https://github.com/taingmeng","followers_url":"https://api.github.com/users/taingmeng/followers","following_url":"https://api.github.com/users/taingmeng/following{/other_user}","gists_url":"https://api.github.com/users/taingmeng/gists{/gist_id}","starred_url":"https://api.github.com/users/taingmeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taingmeng/subscriptions","organizations_url":"https://api.github.com/users/taingmeng/orgs","repos_url":"https://api.github.com/users/taingmeng/repos","events_url":"https://api.github.com/users/taingmeng/events{/privacy}","received_events_url":"https://api.github.com/users/taingmeng/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/h6ah4i/android-advancedrecyclerview/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-04-20T10:41:55Z","updated_at":"2016-10-26T06:06:08Z","closed_at":"2016-04-21T15:21:34Z","body":"When there are items in recycleview, and I pull to refresh to get updated items from server, pass them into adapter and call notifyDataSetChanged in the adapter. It caused the recycleview to blink. The adapter here is the original adapter, not the wrapped adapter. Am I updating wrong adapter or is there any addition all steps to avoid the blink?"},"comment":{"url":"https://api.github.com/repos/h6ah4i/android-advancedrecyclerview/issues/comments/256257614","html_url":"https://github.com/h6ah4i/android-advancedrecyclerview/issues/232#issuecomment-256257614","issue_url":"https://api.github.com/repos/h6ah4i/android-advancedrecyclerview/issues/232","id":256257614,"user":{"login":"taingmeng","id":7765045,"avatar_url":"https://avatars.githubusercontent.com/u/7765045?v=3","gravatar_id":"","url":"https://api.github.com/users/taingmeng","html_url":"https://github.com/taingmeng","followers_url":"https://api.github.com/users/taingmeng/followers","following_url":"https://api.github.com/users/taingmeng/following{/other_user}","gists_url":"https://api.github.com/users/taingmeng/gists{/gist_id}","starred_url":"https://api.github.com/users/taingmeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taingmeng/subscriptions","organizations_url":"https://api.github.com/users/taingmeng/orgs","repos_url":"https://api.github.com/users/taingmeng/repos","events_url":"https://api.github.com/users/taingmeng/events{/privacy}","received_events_url":"https://api.github.com/users/taingmeng/received_events","type":"User","site_admin":false},"created_at":"2016-10-26T06:06:07Z","updated_at":"2016-10-26T06:06:07Z","body":"By returning the position as id, I don't think it will work as you expected. Usually I return the unique attribute of the item at that position, for example, \r\n```\r\n@Override\r\npublic long getItemId(int position) {\r\n    return items.get(position).getId();\r\n}\r\n```\r\nIn your case, if each string in strings is unique, you can try: \r\n```\r\n@Override\r\npublic long getItemId(int position) {\r\n    return strings.get(position).hashCode();\r\n}\r\n```\r\nIt is not a fool-proof solution, but it should work."}}
{"actor":{"display_login":"taingmeng"}}