{"action":"created","comment":{"url":"https://api.github.com/repos/novoda/view-pager-adapter/pulls/comments/121974486","pull_request_review_id":44048362,"id":121974486,"diff_hunk":"@@ -51,7 +56,7 @@ public V instantiateItem(ViewGroup container, int position) {\n      * @param position  the position of the data set that is to be represented by this view\n      * @param viewState the state of the view\n      */\n-    protected void bindView(V view, int position, @Nullable SparseArray<Parcelable> viewState) {\n+    private void bindView(V view, int position, @Nullable SparseArray<Parcelable> viewState) {","path":"library/src/main/java/com/novoda/viewpageradapter/ViewPagerAdapter.java","position":34,"original_position":34,"commit_id":"98ed15d8daa7b218281d7e83dc4f29447026bfa3","original_commit_id":"98ed15d8daa7b218281d7e83dc4f29447026bfa3","user":{"login":"joetimmins","id":10560214,"avatar_url":"https://avatars2.githubusercontent.com/u/10560214?v=3","gravatar_id":"","url":"https://api.github.com/users/joetimmins","html_url":"https://github.com/joetimmins","followers_url":"https://api.github.com/users/joetimmins/followers","following_url":"https://api.github.com/users/joetimmins/following{/other_user}","gists_url":"https://api.github.com/users/joetimmins/gists{/gist_id}","starred_url":"https://api.github.com/users/joetimmins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joetimmins/subscriptions","organizations_url":"https://api.github.com/users/joetimmins/orgs","repos_url":"https://api.github.com/users/joetimmins/repos","events_url":"https://api.github.com/users/joetimmins/events{/privacy}","received_events_url":"https://api.github.com/users/joetimmins/received_events","type":"User","site_admin":false},"body":"@eduardb @ouchadam Is passing a `SparseArray` really the best way of accomplishing that? If I read through this code, there's nothing about this method that would make me think \"okay, we need this `SparseArray` here to tell if we've bound to this view before or not\". Wouldn't it be better to handle that on the view itself?","created_at":"2017-06-14T15:05:09Z","updated_at":"2017-06-14T15:05:09Z","html_url":"https://github.com/novoda/view-pager-adapter/pull/16#discussion_r121974486","pull_request_url":"https://api.github.com/repos/novoda/view-pager-adapter/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/novoda/view-pager-adapter/pulls/comments/121974486"},"html":{"href":"https://github.com/novoda/view-pager-adapter/pull/16#discussion_r121974486"},"pull_request":{"href":"https://api.github.com/repos/novoda/view-pager-adapter/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/novoda/view-pager-adapter/pulls/16","id":125426943,"html_url":"https://github.com/novoda/view-pager-adapter/pull/16","diff_url":"https://github.com/novoda/view-pager-adapter/pull/16.diff","patch_url":"https://github.com/novoda/view-pager-adapter/pull/16.patch","issue_url":"https://api.github.com/repos/novoda/view-pager-adapter/issues/16","number":16,"state":"open","locked":false,"title":"Don't use restoredId if there's no id to restore","user":{"login":"joetimmins","id":10560214,"avatar_url":"https://avatars2.githubusercontent.com/u/10560214?v=3","gravatar_id":"","url":"https://api.github.com/users/joetimmins","html_url":"https://github.com/joetimmins","followers_url":"https://api.github.com/users/joetimmins/followers","following_url":"https://api.github.com/users/joetimmins/following{/other_user}","gists_url":"https://api.github.com/users/joetimmins/gists{/gist_id}","starred_url":"https://api.github.com/users/joetimmins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joetimmins/subscriptions","organizations_url":"https://api.github.com/users/joetimmins/orgs","repos_url":"https://api.github.com/users/joetimmins/repos","events_url":"https://api.github.com/users/joetimmins/events{/privacy}","received_events_url":"https://api.github.com/users/joetimmins/received_events","type":"User","site_admin":false},"body":"#### Problem/Goal\r\nWhen integrating v0.9.6 into a client project, we found a crash on launching a specific activity.\r\n\r\nThis was happening because a view's id was being changed by the ViewPagerAdapter class, meaning when we called `findViewById` to try and obtain it, we got `null`.\r\n\r\nThe id was changed because there was no previous instances of a view at that position in the `ViewPagerAdapterState` instance, so it was being re-assigned.\r\n\r\n#### Solution\r\nThe solution was just to make sure that only views with no id have an id assigned to them.\r\n\r\n##### Test(s) added \r\nNo tests added as there are no tests in this entire project.\r\n\r\n##### Screenshots\r\nNo screenshots I'm afraid, but the demo app still works the same, and our client project doesn't crash now.","created_at":"2017-06-13T18:08:35Z","updated_at":"2017-06-14T15:05:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f306497d57cd5039c97a7a22b688661ddef84014","assignee":{"login":"ataulm","id":2678555,"avatar_url":"https://avatars2.githubusercontent.com/u/2678555?v=3","gravatar_id":"","url":"https://api.github.com/users/ataulm","html_url":"https://github.com/ataulm","followers_url":"https://api.github.com/users/ataulm/followers","following_url":"https://api.github.com/users/ataulm/following{/other_user}","gists_url":"https://api.github.com/users/ataulm/gists{/gist_id}","starred_url":"https://api.github.com/users/ataulm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ataulm/subscriptions","organizations_url":"https://api.github.com/users/ataulm/orgs","repos_url":"https://api.github.com/users/ataulm/repos","events_url":"https://api.github.com/users/ataulm/events{/privacy}","received_events_url":"https://api.github.com/users/ataulm/received_events","type":"User","site_admin":false},"assignees":[{"login":"ataulm","id":2678555,"avatar_url":"https://avatars2.githubusercontent.com/u/2678555?v=3","gravatar_id":"","url":"https://api.github.com/users/ataulm","html_url":"https://github.com/ataulm","followers_url":"https://api.github.com/users/ataulm/followers","following_url":"https://api.github.com/users/ataulm/following{/other_user}","gists_url":"https://api.github.com/users/ataulm/gists{/gist_id}","starred_url":"https://api.github.com/users/ataulm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ataulm/subscriptions","organizations_url":"https://api.github.com/users/ataulm/orgs","repos_url":"https://api.github.com/users/ataulm/repos","events_url":"https://api.github.com/users/ataulm/events{/privacy}","received_events_url":"https://api.github.com/users/ataulm/received_events","type":"User","site_admin":false},{"login":"Mecharyry","id":3380092,"avatar_url":"https://avatars2.githubusercontent.com/u/3380092?v=3","gravatar_id":"","url":"https://api.github.com/users/Mecharyry","html_url":"https://github.com/Mecharyry","followers_url":"https://api.github.com/users/Mecharyry/followers","following_url":"https://api.github.com/users/Mecharyry/following{/other_user}","gists_url":"https://api.github.com/users/Mecharyry/gists{/gist_id}","starred_url":"https://api.github.com/users/Mecharyry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mecharyry/subscriptions","organizations_url":"https://api.github.com/users/Mecharyry/orgs","repos_url":"https://api.github.com/users/Mecharyry/repos","events_url":"https://api.github.com/users/Mecharyry/events{/privacy}","received_events_url":"https://api.github.com/users/Mecharyry/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"Mecharyry","id":3380092,"avatar_url":"https://avatars2.githubusercontent.com/u/3380092?v=3","gravatar_id":"","url":"https://api.github.com/users/Mecharyry","html_url":"https://github.com/Mecharyry","followers_url":"https://api.github.com/users/Mecharyry/followers","following_url":"https://api.github.com/users/Mecharyry/following{/other_user}","gists_url":"https://api.github.com/users/Mecharyry/gists{/gist_id}","starred_url":"https://api.github.com/users/Mecharyry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mecharyry/subscriptions","organizations_url":"https://api.github.com/users/Mecharyry/orgs","repos_url":"https://api.github.com/users/Mecharyry/repos","events_url":"https://api.github.com/users/Mecharyry/events{/privacy}","received_events_url":"https://api.github.com/users/Mecharyry/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/novoda/view-pager-adapter/pulls/16/commits","review_comments_url":"https://api.github.com/repos/novoda/view-pager-adapter/pulls/16/comments","review_comment_url":"https://api.github.com/repos/novoda/view-pager-adapter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/novoda/view-pager-adapter/issues/16/comments","statuses_url":"https://api.github.com/repos/novoda/view-pager-adapter/statuses/98ed15d8daa7b218281d7e83dc4f29447026bfa3","head":{"label":"novoda:dont-use-restoredid-if-theres-no-id-to-restore","ref":"dont-use-restoredid-if-theres-no-id-to-restore","sha":"98ed15d8daa7b218281d7e83dc4f29447026bfa3","user":{"login":"novoda","id":74874,"avatar_url":"https://avatars1.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"repo":{"id":55979944,"name":"view-pager-adapter","full_name":"novoda/view-pager-adapter","owner":{"login":"novoda","id":74874,"avatar_url":"https://avatars1.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/novoda/view-pager-adapter","description":"A simple implementation of PagerAdapter that supports Views.","fork":false,"url":"https://api.github.com/repos/novoda/view-pager-adapter","forks_url":"https://api.github.com/repos/novoda/view-pager-adapter/forks","keys_url":"https://api.github.com/repos/novoda/view-pager-adapter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/novoda/view-pager-adapter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/novoda/view-pager-adapter/teams","hooks_url":"https://api.github.com/repos/novoda/view-pager-adapter/hooks","issue_events_url":"https://api.github.com/repos/novoda/view-pager-adapter/issues/events{/number}","events_url":"https://api.github.com/repos/novoda/view-pager-adapter/events","assignees_url":"https://api.github.com/repos/novoda/view-pager-adapter/assignees{/user}","branches_url":"https://api.github.com/repos/novoda/view-pager-adapter/branches{/branch}","tags_url":"https://api.github.com/repos/novoda/view-pager-adapter/tags","blobs_url":"https://api.github.com/repos/novoda/view-pager-adapter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/novoda/view-pager-adapter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/novoda/view-pager-adapter/git/refs{/sha}","trees_url":"https://api.github.com/repos/novoda/view-pager-adapter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/novoda/view-pager-adapter/statuses/{sha}","languages_url":"https://api.github.com/repos/novoda/view-pager-adapter/languages","stargazers_url":"https://api.github.com/repos/novoda/view-pager-adapter/stargazers","contributors_url":"https://api.github.com/repos/novoda/view-pager-adapter/contributors","subscribers_url":"https://api.github.com/repos/novoda/view-pager-adapter/subscribers","subscription_url":"https://api.github.com/repos/novoda/view-pager-adapter/subscription","commits_url":"https://api.github.com/repos/novoda/view-pager-adapter/commits{/sha}","git_commits_url":"https://api.github.com/repos/novoda/view-pager-adapter/git/commits{/sha}","comments_url":"https://api.github.com/repos/novoda/view-pager-adapter/comments{/number}","issue_comment_url":"https://api.github.com/repos/novoda/view-pager-adapter/issues/comments{/number}","contents_url":"https://api.github.com/repos/novoda/view-pager-adapter/contents/{+path}","compare_url":"https://api.github.com/repos/novoda/view-pager-adapter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/novoda/view-pager-adapter/merges","archive_url":"https://api.github.com/repos/novoda/view-pager-adapter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/novoda/view-pager-adapter/downloads","issues_url":"https://api.github.com/repos/novoda/view-pager-adapter/issues{/number}","pulls_url":"https://api.github.com/repos/novoda/view-pager-adapter/pulls{/number}","milestones_url":"https://api.github.com/repos/novoda/view-pager-adapter/milestones{/number}","notifications_url":"https://api.github.com/repos/novoda/view-pager-adapter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/novoda/view-pager-adapter/labels{/name}","releases_url":"https://api.github.com/repos/novoda/view-pager-adapter/releases{/id}","deployments_url":"https://api.github.com/repos/novoda/view-pager-adapter/deployments","created_at":"2016-04-11T14:35:48Z","updated_at":"2017-06-02T08:09:00Z","pushed_at":"2017-06-13T18:08:35Z","git_url":"git://github.com/novoda/view-pager-adapter.git","ssh_url":"git@github.com:novoda/view-pager-adapter.git","clone_url":"https://github.com/novoda/view-pager-adapter.git","svn_url":"https://github.com/novoda/view-pager-adapter","homepage":null,"size":159,"stargazers_count":17,"watchers_count":17,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":17,"default_branch":"master"}},"base":{"label":"novoda:master","ref":"master","sha":"489eebf98dfb88f11f8f1604d67dd51d58d99c7b","user":{"login":"novoda","id":74874,"avatar_url":"https://avatars1.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"repo":{"id":55979944,"name":"view-pager-adapter","full_name":"novoda/view-pager-adapter","owner":{"login":"novoda","id":74874,"avatar_url":"https://avatars1.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/novoda/view-pager-adapter","description":"A simple implementation of PagerAdapter that supports Views.","fork":false,"url":"https://api.github.com/repos/novoda/view-pager-adapter","forks_url":"https://api.github.com/repos/novoda/view-pager-adapter/forks","keys_url":"https://api.github.com/repos/novoda/view-pager-adapter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/novoda/view-pager-adapter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/novoda/view-pager-adapter/teams","hooks_url":"https://api.github.com/repos/novoda/view-pager-adapter/hooks","issue_events_url":"https://api.github.com/repos/novoda/view-pager-adapter/issues/events{/number}","events_url":"https://api.github.com/repos/novoda/view-pager-adapter/events","assignees_url":"https://api.github.com/repos/novoda/view-pager-adapter/assignees{/user}","branches_url":"https://api.github.com/repos/novoda/view-pager-adapter/branches{/branch}","tags_url":"https://api.github.com/repos/novoda/view-pager-adapter/tags","blobs_url":"https://api.github.com/repos/novoda/view-pager-adapter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/novoda/view-pager-adapter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/novoda/view-pager-adapter/git/refs{/sha}","trees_url":"https://api.github.com/repos/novoda/view-pager-adapter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/novoda/view-pager-adapter/statuses/{sha}","languages_url":"https://api.github.com/repos/novoda/view-pager-adapter/languages","stargazers_url":"https://api.github.com/repos/novoda/view-pager-adapter/stargazers","contributors_url":"https://api.github.com/repos/novoda/view-pager-adapter/contributors","subscribers_url":"https://api.github.com/repos/novoda/view-pager-adapter/subscribers","subscription_url":"https://api.github.com/repos/novoda/view-pager-adapter/subscription","commits_url":"https://api.github.com/repos/novoda/view-pager-adapter/commits{/sha}","git_commits_url":"https://api.github.com/repos/novoda/view-pager-adapter/git/commits{/sha}","comments_url":"https://api.github.com/repos/novoda/view-pager-adapter/comments{/number}","issue_comment_url":"https://api.github.com/repos/novoda/view-pager-adapter/issues/comments{/number}","contents_url":"https://api.github.com/repos/novoda/view-pager-adapter/contents/{+path}","compare_url":"https://api.github.com/repos/novoda/view-pager-adapter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/novoda/view-pager-adapter/merges","archive_url":"https://api.github.com/repos/novoda/view-pager-adapter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/novoda/view-pager-adapter/downloads","issues_url":"https://api.github.com/repos/novoda/view-pager-adapter/issues{/number}","pulls_url":"https://api.github.com/repos/novoda/view-pager-adapter/pulls{/number}","milestones_url":"https://api.github.com/repos/novoda/view-pager-adapter/milestones{/number}","notifications_url":"https://api.github.com/repos/novoda/view-pager-adapter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/novoda/view-pager-adapter/labels{/name}","releases_url":"https://api.github.com/repos/novoda/view-pager-adapter/releases{/id}","deployments_url":"https://api.github.com/repos/novoda/view-pager-adapter/deployments","created_at":"2016-04-11T14:35:48Z","updated_at":"2017-06-02T08:09:00Z","pushed_at":"2017-06-13T18:08:35Z","git_url":"git://github.com/novoda/view-pager-adapter.git","ssh_url":"git@github.com:novoda/view-pager-adapter.git","clone_url":"https://github.com/novoda/view-pager-adapter.git","svn_url":"https://github.com/novoda/view-pager-adapter","homepage":null,"size":159,"stargazers_count":17,"watchers_count":17,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/novoda/view-pager-adapter/pulls/16"},"html":{"href":"https://github.com/novoda/view-pager-adapter/pull/16"},"issue":{"href":"https://api.github.com/repos/novoda/view-pager-adapter/issues/16"},"comments":{"href":"https://api.github.com/repos/novoda/view-pager-adapter/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/novoda/view-pager-adapter/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/novoda/view-pager-adapter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/novoda/view-pager-adapter/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/novoda/view-pager-adapter/statuses/98ed15d8daa7b218281d7e83dc4f29447026bfa3"}}}}
{"actor":{"display_login":"joetimmins"}}