{"action":"created","comment":{"url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/comments/25724330","id":25724330,"diff_hunk":"@@ -91,6 +91,18 @@ public void onNewIntent() {\n     getLoaderManager().restartLoader(0, null, this);\n   }\n \n+  @Override\n+  public void onResume() {\n+    super.onResume();\n+    getLoaderManager().initLoader(0, null, this);\n+  }\n+\n+  @Override\n+  public void onPause() {\n+    super.onPause();\n+    getLoaderManager().destroyLoader(0);","path":"src/org/thoughtcrime/securesms/ConversationFragment.java","position":13,"original_position":13,"commit_id":"aa71ba0166d2d640879dbde79a94620f588fcc95","original_commit_id":"aa71ba0166d2d640879dbde79a94620f588fcc95","user":{"login":"rhodey","id":3441581,"avatar_url":"https://avatars.githubusercontent.com/u/3441581?v=3","gravatar_id":"","url":"https://api.github.com/users/rhodey","html_url":"https://github.com/rhodey","followers_url":"https://api.github.com/users/rhodey/followers","following_url":"https://api.github.com/users/rhodey/following{/other_user}","gists_url":"https://api.github.com/users/rhodey/gists{/gist_id}","starred_url":"https://api.github.com/users/rhodey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhodey/subscriptions","organizations_url":"https://api.github.com/users/rhodey/orgs","repos_url":"https://api.github.com/users/rhodey/repos","events_url":"https://api.github.com/users/rhodey/events{/privacy}","received_events_url":"https://api.github.com/users/rhodey/received_events","type":"User","site_admin":false},"body":"`initLoader()` should be called before any other `LoaderManager` method because it handles some needed initialization but in addition to this it also creates a new loader. So if we placed `restartLoader()` in `onResume()` we'd have to place `initLoader()` in either `onCreate()` or `onResume()` and this would result in one loader being needlessly created.","created_at":"2015-03-03T20:39:39Z","updated_at":"2015-03-03T20:39:39Z","html_url":"https://github.com/WhisperSystems/TextSecure/pull/2556#discussion_r25724330","pull_request_url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2556","_links":{"self":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/comments/25724330"},"html":{"href":"https://github.com/WhisperSystems/TextSecure/pull/2556#discussion_r25724330"},"pull_request":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2556"}}},"pull_request":{"url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2556","id":30339061,"html_url":"https://github.com/WhisperSystems/TextSecure/pull/2556","diff_url":"https://github.com/WhisperSystems/TextSecure/pull/2556.diff","patch_url":"https://github.com/WhisperSystems/TextSecure/pull/2556.patch","issue_url":"https://api.github.com/repos/WhisperSystems/TextSecure/issues/2556","number":2556,"state":"open","locked":false,"title":"message timestamps update onResume()","user":{"login":"rhodey","id":3441581,"avatar_url":"https://avatars.githubusercontent.com/u/3441581?v=3","gravatar_id":"","url":"https://api.github.com/users/rhodey","html_url":"https://github.com/rhodey","followers_url":"https://api.github.com/users/rhodey/followers","following_url":"https://api.github.com/users/rhodey/following{/other_user}","gists_url":"https://api.github.com/users/rhodey/gists{/gist_id}","starred_url":"https://api.github.com/users/rhodey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhodey/subscriptions","organizations_url":"https://api.github.com/users/rhodey/orgs","repos_url":"https://api.github.com/users/rhodey/repos","events_url":"https://api.github.com/users/rhodey/events{/privacy}","received_events_url":"https://api.github.com/users/rhodey/received_events","type":"User","site_admin":false},"body":"Modified conversation view and conversation list view to update message timestamps onResume.\r\n\r\nThe basics of this is that `LoaderManager.initLoader()` is now called `onResume()` instead of `onCreate()` and `LoaderManager.destroyLoader()` is now called `onPause()` so that a new loader will be created `onResume()` which will force the timestamps to update.\r\n\r\nThe null check and `-1` check on `this.recipients` and `this.threadId` is to handle the case of a new conversation thread where the list of messages would be empty-- in this case no `ListAdapter` is set so these checks prevent an NPE within two of the `LoaderManager` callbacks.\r\n\r\nFixes #2519","created_at":"2015-03-03T01:33:13Z","updated_at":"2015-03-03T20:39:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66bdc111f3d6f8e74606e5d1a0f466fd3443b1ff","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2556/commits","review_comments_url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2556/comments","review_comment_url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WhisperSystems/TextSecure/issues/2556/comments","statuses_url":"https://api.github.com/repos/WhisperSystems/TextSecure/statuses/aa71ba0166d2d640879dbde79a94620f588fcc95","head":{"label":"rhodey:issue-2519","ref":"issue-2519","sha":"aa71ba0166d2d640879dbde79a94620f588fcc95","user":{"login":"rhodey","id":3441581,"avatar_url":"https://avatars.githubusercontent.com/u/3441581?v=3","gravatar_id":"","url":"https://api.github.com/users/rhodey","html_url":"https://github.com/rhodey","followers_url":"https://api.github.com/users/rhodey/followers","following_url":"https://api.github.com/users/rhodey/following{/other_user}","gists_url":"https://api.github.com/users/rhodey/gists{/gist_id}","starred_url":"https://api.github.com/users/rhodey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhodey/subscriptions","organizations_url":"https://api.github.com/users/rhodey/orgs","repos_url":"https://api.github.com/users/rhodey/repos","events_url":"https://api.github.com/users/rhodey/events{/privacy}","received_events_url":"https://api.github.com/users/rhodey/received_events","type":"User","site_admin":false},"repo":{"id":31562260,"name":"TextSecure","full_name":"rhodey/TextSecure","owner":{"login":"rhodey","id":3441581,"avatar_url":"https://avatars.githubusercontent.com/u/3441581?v=3","gravatar_id":"","url":"https://api.github.com/users/rhodey","html_url":"https://github.com/rhodey","followers_url":"https://api.github.com/users/rhodey/followers","following_url":"https://api.github.com/users/rhodey/following{/other_user}","gists_url":"https://api.github.com/users/rhodey/gists{/gist_id}","starred_url":"https://api.github.com/users/rhodey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhodey/subscriptions","organizations_url":"https://api.github.com/users/rhodey/orgs","repos_url":"https://api.github.com/users/rhodey/repos","events_url":"https://api.github.com/users/rhodey/events{/privacy}","received_events_url":"https://api.github.com/users/rhodey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rhodey/TextSecure","description":"A secure text messaging application for Android.","fork":true,"url":"https://api.github.com/repos/rhodey/TextSecure","forks_url":"https://api.github.com/repos/rhodey/TextSecure/forks","keys_url":"https://api.github.com/repos/rhodey/TextSecure/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhodey/TextSecure/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhodey/TextSecure/teams","hooks_url":"https://api.github.com/repos/rhodey/TextSecure/hooks","issue_events_url":"https://api.github.com/repos/rhodey/TextSecure/issues/events{/number}","events_url":"https://api.github.com/repos/rhodey/TextSecure/events","assignees_url":"https://api.github.com/repos/rhodey/TextSecure/assignees{/user}","branches_url":"https://api.github.com/repos/rhodey/TextSecure/branches{/branch}","tags_url":"https://api.github.com/repos/rhodey/TextSecure/tags","blobs_url":"https://api.github.com/repos/rhodey/TextSecure/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhodey/TextSecure/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhodey/TextSecure/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhodey/TextSecure/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhodey/TextSecure/statuses/{sha}","languages_url":"https://api.github.com/repos/rhodey/TextSecure/languages","stargazers_url":"https://api.github.com/repos/rhodey/TextSecure/stargazers","contributors_url":"https://api.github.com/repos/rhodey/TextSecure/contributors","subscribers_url":"https://api.github.com/repos/rhodey/TextSecure/subscribers","subscription_url":"https://api.github.com/repos/rhodey/TextSecure/subscription","commits_url":"https://api.github.com/repos/rhodey/TextSecure/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhodey/TextSecure/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhodey/TextSecure/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhodey/TextSecure/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhodey/TextSecure/contents/{+path}","compare_url":"https://api.github.com/repos/rhodey/TextSecure/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhodey/TextSecure/merges","archive_url":"https://api.github.com/repos/rhodey/TextSecure/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhodey/TextSecure/downloads","issues_url":"https://api.github.com/repos/rhodey/TextSecure/issues{/number}","pulls_url":"https://api.github.com/repos/rhodey/TextSecure/pulls{/number}","milestones_url":"https://api.github.com/repos/rhodey/TextSecure/milestones{/number}","notifications_url":"https://api.github.com/repos/rhodey/TextSecure/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhodey/TextSecure/labels{/name}","releases_url":"https://api.github.com/repos/rhodey/TextSecure/releases{/id}","created_at":"2015-03-02T20:46:02Z","updated_at":"2015-03-02T20:46:05Z","pushed_at":"2015-03-03T19:04:23Z","git_url":"git://github.com/rhodey/TextSecure.git","ssh_url":"git@github.com:rhodey/TextSecure.git","clone_url":"https://github.com/rhodey/TextSecure.git","svn_url":"https://github.com/rhodey/TextSecure","homepage":"","size":60422,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"WhisperSystems:master","ref":"master","sha":"ed5b3f867997ec2778e032d8753c3a54a5e23c93","user":{"login":"WhisperSystems","id":702459,"avatar_url":"https://avatars.githubusercontent.com/u/702459?v=3","gravatar_id":"","url":"https://api.github.com/users/WhisperSystems","html_url":"https://github.com/WhisperSystems","followers_url":"https://api.github.com/users/WhisperSystems/followers","following_url":"https://api.github.com/users/WhisperSystems/following{/other_user}","gists_url":"https://api.github.com/users/WhisperSystems/gists{/gist_id}","starred_url":"https://api.github.com/users/WhisperSystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WhisperSystems/subscriptions","organizations_url":"https://api.github.com/users/WhisperSystems/orgs","repos_url":"https://api.github.com/users/WhisperSystems/repos","events_url":"https://api.github.com/users/WhisperSystems/events{/privacy}","received_events_url":"https://api.github.com/users/WhisperSystems/received_events","type":"Organization","site_admin":false},"repo":{"id":2990192,"name":"TextSecure","full_name":"WhisperSystems/TextSecure","owner":{"login":"WhisperSystems","id":702459,"avatar_url":"https://avatars.githubusercontent.com/u/702459?v=3","gravatar_id":"","url":"https://api.github.com/users/WhisperSystems","html_url":"https://github.com/WhisperSystems","followers_url":"https://api.github.com/users/WhisperSystems/followers","following_url":"https://api.github.com/users/WhisperSystems/following{/other_user}","gists_url":"https://api.github.com/users/WhisperSystems/gists{/gist_id}","starred_url":"https://api.github.com/users/WhisperSystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WhisperSystems/subscriptions","organizations_url":"https://api.github.com/users/WhisperSystems/orgs","repos_url":"https://api.github.com/users/WhisperSystems/repos","events_url":"https://api.github.com/users/WhisperSystems/events{/privacy}","received_events_url":"https://api.github.com/users/WhisperSystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WhisperSystems/TextSecure","description":"A secure text messaging application for Android.","fork":false,"url":"https://api.github.com/repos/WhisperSystems/TextSecure","forks_url":"https://api.github.com/repos/WhisperSystems/TextSecure/forks","keys_url":"https://api.github.com/repos/WhisperSystems/TextSecure/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WhisperSystems/TextSecure/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WhisperSystems/TextSecure/teams","hooks_url":"https://api.github.com/repos/WhisperSystems/TextSecure/hooks","issue_events_url":"https://api.github.com/repos/WhisperSystems/TextSecure/issues/events{/number}","events_url":"https://api.github.com/repos/WhisperSystems/TextSecure/events","assignees_url":"https://api.github.com/repos/WhisperSystems/TextSecure/assignees{/user}","branches_url":"https://api.github.com/repos/WhisperSystems/TextSecure/branches{/branch}","tags_url":"https://api.github.com/repos/WhisperSystems/TextSecure/tags","blobs_url":"https://api.github.com/repos/WhisperSystems/TextSecure/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WhisperSystems/TextSecure/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WhisperSystems/TextSecure/git/refs{/sha}","trees_url":"https://api.github.com/repos/WhisperSystems/TextSecure/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WhisperSystems/TextSecure/statuses/{sha}","languages_url":"https://api.github.com/repos/WhisperSystems/TextSecure/languages","stargazers_url":"https://api.github.com/repos/WhisperSystems/TextSecure/stargazers","contributors_url":"https://api.github.com/repos/WhisperSystems/TextSecure/contributors","subscribers_url":"https://api.github.com/repos/WhisperSystems/TextSecure/subscribers","subscription_url":"https://api.github.com/repos/WhisperSystems/TextSecure/subscription","commits_url":"https://api.github.com/repos/WhisperSystems/TextSecure/commits{/sha}","git_commits_url":"https://api.github.com/repos/WhisperSystems/TextSecure/git/commits{/sha}","comments_url":"https://api.github.com/repos/WhisperSystems/TextSecure/comments{/number}","issue_comment_url":"https://api.github.com/repos/WhisperSystems/TextSecure/issues/comments{/number}","contents_url":"https://api.github.com/repos/WhisperSystems/TextSecure/contents/{+path}","compare_url":"https://api.github.com/repos/WhisperSystems/TextSecure/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WhisperSystems/TextSecure/merges","archive_url":"https://api.github.com/repos/WhisperSystems/TextSecure/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WhisperSystems/TextSecure/downloads","issues_url":"https://api.github.com/repos/WhisperSystems/TextSecure/issues{/number}","pulls_url":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls{/number}","milestones_url":"https://api.github.com/repos/WhisperSystems/TextSecure/milestones{/number}","notifications_url":"https://api.github.com/repos/WhisperSystems/TextSecure/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WhisperSystems/TextSecure/labels{/name}","releases_url":"https://api.github.com/repos/WhisperSystems/TextSecure/releases{/id}","created_at":"2011-12-15T20:01:12Z","updated_at":"2015-03-03T20:28:24Z","pushed_at":"2015-03-03T20:25:27Z","git_url":"git://github.com/WhisperSystems/TextSecure.git","ssh_url":"git@github.com:WhisperSystems/TextSecure.git","clone_url":"https://github.com/WhisperSystems/TextSecure.git","svn_url":"https://github.com/WhisperSystems/TextSecure","homepage":"","size":60422,"stargazers_count":3611,"watchers_count":3611,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1018,"mirror_url":null,"open_issues_count":500,"forks":1018,"open_issues":500,"watchers":3611,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2556"},"html":{"href":"https://github.com/WhisperSystems/TextSecure/pull/2556"},"issue":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/issues/2556"},"comments":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/issues/2556/comments"},"review_comments":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2556/comments"},"review_comment":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/pulls/2556/commits"},"statuses":{"href":"https://api.github.com/repos/WhisperSystems/TextSecure/statuses/aa71ba0166d2d640879dbde79a94620f588fcc95"}}}}