{"action":"created","comment":{"url":"https://api.github.com/repos/leancloud/docs/pulls/comments/26639845","id":26639845,"diff_hunk":"@@ -527,27 +533,27 @@ conversation.sendMessage(message, new AVIMConversationCallback() {\n 新版 LeanCloud IM SDK 内部封装了对富媒体消息的支持，所有富媒体消息都是从 AVIMTypedMessage 派生出来的。发送的时候可以直接调用 `conversation.sendMessage` 函数。在接收端，我们也专门增加了一类回调接口：\n \n ```\n-public abstract class AVIMTypedMessageHandler<T extends AVIMTypedMessage> extends MessageHandler<T> {\n+public class AVIMTypedMessageHandler<T extends AVIMTypedMessage> extends MessageHandler<T> {\n \n   @Override\n-  public abstract void onMessage(T message, AVIMConversation conversation);\n+  public void onMessage(T message, AVIMConversation conversation);\n \n   @Override\n-  public abstract void onMessageReceipt(T message, AVIMConversation conversation);\n+  public void onMessageReceipt(T message, AVIMConversation conversation);\n }\n ```\n \n 开发者可以编写自己的消息处理 handler，然后调用 `AVIMMessageManager.registerMessageHandler(Class<? extends AVIMMessage> clazz,\n       MessageHandler<?> handler)` 函数来注册目标 handler。\n       \n-LeanCloud IM SDK 内部消息分发的逻辑是这样的：对于收到的任一新消息，SDK 内部都会先解析消息的类型，然后找到开发者为这一类型注册的处理 handler，然后逐一调用这些 handler 的 onMessage 函数。如果没有找到专门处理这一类型消息的 handler，就会转交给 defaultHandler 处理。\n+LeanCloud IM SDK 内部消息分发的逻辑是这样的：对于收到的任一新消息，SDK 内部都会先解析消息的类型，根据类型找到开发者为这一类型注册的处理 handler，然后逐一调用这些 handler 的 onMessage 函数。如果没有找到专门处理这一类型消息的 handler，就会转交给 defaultHandler 处理。\n \n 这样一来，在开发者为 TypedMessage（及其子类） 指定了专门的 handler，也指定了全局的 defaultHandler 了的时候，如果发送端发送的是通用的 AVIMMessage 消息，那么接受端就是 **AVIMMessageManager.registerDefaultMessageHandler()中指定的 handler** 被调用；如果发送的是 AVIMTypedMessage（及其子类）的消息，那么接受端就是 **AVIMMessageManager.registerMessageHandler()中指定的 handler** 被调用。\n \n 接收端对于富媒体消息的通知处理代码片段如下：\n \n ```\n-class MsgHandler extends MessageHandler<AVIMTypedMessage> {\n+class MsgHandler extends AVIMTypedMessageHandler {","path":"md/android_realtime_v2.md","position":142,"original_position":142,"commit_id":"e1e32efa3c9bd650817ca8218a3751f2b1a97ec3","original_commit_id":"e1e32efa3c9bd650817ca8218a3751f2b1a97ec3","user":{"login":"killme2008","id":14142,"avatar_url":"https://avatars.githubusercontent.com/u/14142?v=3","gravatar_id":"","url":"https://api.github.com/users/killme2008","html_url":"https://github.com/killme2008","followers_url":"https://api.github.com/users/killme2008/followers","following_url":"https://api.github.com/users/killme2008/following{/other_user}","gists_url":"https://api.github.com/users/killme2008/gists{/gist_id}","starred_url":"https://api.github.com/users/killme2008/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/killme2008/subscriptions","organizations_url":"https://api.github.com/users/killme2008/orgs","repos_url":"https://api.github.com/users/killme2008/repos","events_url":"https://api.github.com/users/killme2008/events{/privacy}","received_events_url":"https://api.github.com/users/killme2008/received_events","type":"User","site_admin":false},"body":"看错了，忽略","created_at":"2015-03-18T05:43:42Z","updated_at":"2015-03-18T05:43:42Z","html_url":"https://github.com/leancloud/docs/pull/137#discussion_r26639845","pull_request_url":"https://api.github.com/repos/leancloud/docs/pulls/137","_links":{"self":{"href":"https://api.github.com/repos/leancloud/docs/pulls/comments/26639845"},"html":{"href":"https://github.com/leancloud/docs/pull/137#discussion_r26639845"},"pull_request":{"href":"https://api.github.com/repos/leancloud/docs/pulls/137"}}},"pull_request":{"url":"https://api.github.com/repos/leancloud/docs/pulls/137","id":31401706,"html_url":"https://github.com/leancloud/docs/pull/137","diff_url":"https://github.com/leancloud/docs/pull/137.diff","patch_url":"https://github.com/leancloud/docs/pull/137.patch","issue_url":"https://api.github.com/repos/leancloud/docs/issues/137","number":137,"state":"open","locked":false,"title":"modify android guide bcz code change, add transient conversation sample","user":{"login":"jwfing","id":985038,"avatar_url":"https://avatars.githubusercontent.com/u/985038?v=3","gravatar_id":"","url":"https://api.github.com/users/jwfing","html_url":"https://github.com/jwfing","followers_url":"https://api.github.com/users/jwfing/followers","following_url":"https://api.github.com/users/jwfing/following{/other_user}","gists_url":"https://api.github.com/users/jwfing/gists{/gist_id}","starred_url":"https://api.github.com/users/jwfing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwfing/subscriptions","organizations_url":"https://api.github.com/users/jwfing/orgs","repos_url":"https://api.github.com/users/jwfing/repos","events_url":"https://api.github.com/users/jwfing/events{/privacy}","received_events_url":"https://api.github.com/users/jwfing/received_events","type":"User","site_admin":false},"body":"@lbt05 @lzwjava @killme2008 ","created_at":"2015-03-18T05:33:49Z","updated_at":"2015-03-18T05:43:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25e347936ac1301be927245aa7718173eac0de58","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/leancloud/docs/pulls/137/commits","review_comments_url":"https://api.github.com/repos/leancloud/docs/pulls/137/comments","review_comment_url":"https://api.github.com/repos/leancloud/docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/leancloud/docs/issues/137/comments","statuses_url":"https://api.github.com/repos/leancloud/docs/statuses/e1e32efa3c9bd650817ca8218a3751f2b1a97ec3","head":{"label":"jwfing:master","ref":"master","sha":"e1e32efa3c9bd650817ca8218a3751f2b1a97ec3","user":{"login":"jwfing","id":985038,"avatar_url":"https://avatars.githubusercontent.com/u/985038?v=3","gravatar_id":"","url":"https://api.github.com/users/jwfing","html_url":"https://github.com/jwfing","followers_url":"https://api.github.com/users/jwfing/followers","following_url":"https://api.github.com/users/jwfing/following{/other_user}","gists_url":"https://api.github.com/users/jwfing/gists{/gist_id}","starred_url":"https://api.github.com/users/jwfing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwfing/subscriptions","organizations_url":"https://api.github.com/users/jwfing/orgs","repos_url":"https://api.github.com/users/jwfing/repos","events_url":"https://api.github.com/users/jwfing/events{/privacy}","received_events_url":"https://api.github.com/users/jwfing/received_events","type":"User","site_admin":false},"repo":{"id":29513312,"name":"docs","full_name":"jwfing/docs","owner":{"login":"jwfing","id":985038,"avatar_url":"https://avatars.githubusercontent.com/u/985038?v=3","gravatar_id":"","url":"https://api.github.com/users/jwfing","html_url":"https://github.com/jwfing","followers_url":"https://api.github.com/users/jwfing/followers","following_url":"https://api.github.com/users/jwfing/following{/other_user}","gists_url":"https://api.github.com/users/jwfing/gists{/gist_id}","starred_url":"https://api.github.com/users/jwfing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwfing/subscriptions","organizations_url":"https://api.github.com/users/jwfing/orgs","repos_url":"https://api.github.com/users/jwfing/repos","events_url":"https://api.github.com/users/jwfing/events{/privacy}","received_events_url":"https://api.github.com/users/jwfing/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jwfing/docs","description":"LeanCloud Documentation","fork":true,"url":"https://api.github.com/repos/jwfing/docs","forks_url":"https://api.github.com/repos/jwfing/docs/forks","keys_url":"https://api.github.com/repos/jwfing/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jwfing/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jwfing/docs/teams","hooks_url":"https://api.github.com/repos/jwfing/docs/hooks","issue_events_url":"https://api.github.com/repos/jwfing/docs/issues/events{/number}","events_url":"https://api.github.com/repos/jwfing/docs/events","assignees_url":"https://api.github.com/repos/jwfing/docs/assignees{/user}","branches_url":"https://api.github.com/repos/jwfing/docs/branches{/branch}","tags_url":"https://api.github.com/repos/jwfing/docs/tags","blobs_url":"https://api.github.com/repos/jwfing/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jwfing/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jwfing/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/jwfing/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jwfing/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/jwfing/docs/languages","stargazers_url":"https://api.github.com/repos/jwfing/docs/stargazers","contributors_url":"https://api.github.com/repos/jwfing/docs/contributors","subscribers_url":"https://api.github.com/repos/jwfing/docs/subscribers","subscription_url":"https://api.github.com/repos/jwfing/docs/subscription","commits_url":"https://api.github.com/repos/jwfing/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/jwfing/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/jwfing/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/jwfing/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/jwfing/docs/contents/{+path}","compare_url":"https://api.github.com/repos/jwfing/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jwfing/docs/merges","archive_url":"https://api.github.com/repos/jwfing/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jwfing/docs/downloads","issues_url":"https://api.github.com/repos/jwfing/docs/issues{/number}","pulls_url":"https://api.github.com/repos/jwfing/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/jwfing/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/jwfing/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jwfing/docs/labels{/name}","releases_url":"https://api.github.com/repos/jwfing/docs/releases{/id}","created_at":"2015-01-20T05:21:44Z","updated_at":"2015-03-18T05:31:09Z","pushed_at":"2015-03-18T05:31:09Z","git_url":"git://github.com/jwfing/docs.git","ssh_url":"git@github.com:jwfing/docs.git","clone_url":"https://github.com/jwfing/docs.git","svn_url":"https://github.com/jwfing/docs","homepage":"http://leancloud.cn/docs/","size":16991,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"leancloud:master","ref":"master","sha":"6344fc67085cbe26eba49b8900946ad078719b04","user":{"login":"leancloud","id":6660518,"avatar_url":"https://avatars.githubusercontent.com/u/6660518?v=3","gravatar_id":"","url":"https://api.github.com/users/leancloud","html_url":"https://github.com/leancloud","followers_url":"https://api.github.com/users/leancloud/followers","following_url":"https://api.github.com/users/leancloud/following{/other_user}","gists_url":"https://api.github.com/users/leancloud/gists{/gist_id}","starred_url":"https://api.github.com/users/leancloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leancloud/subscriptions","organizations_url":"https://api.github.com/users/leancloud/orgs","repos_url":"https://api.github.com/users/leancloud/repos","events_url":"https://api.github.com/users/leancloud/events{/privacy}","received_events_url":"https://api.github.com/users/leancloud/received_events","type":"Organization","site_admin":false},"repo":{"id":25067518,"name":"docs","full_name":"leancloud/docs","owner":{"login":"leancloud","id":6660518,"avatar_url":"https://avatars.githubusercontent.com/u/6660518?v=3","gravatar_id":"","url":"https://api.github.com/users/leancloud","html_url":"https://github.com/leancloud","followers_url":"https://api.github.com/users/leancloud/followers","following_url":"https://api.github.com/users/leancloud/following{/other_user}","gists_url":"https://api.github.com/users/leancloud/gists{/gist_id}","starred_url":"https://api.github.com/users/leancloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leancloud/subscriptions","organizations_url":"https://api.github.com/users/leancloud/orgs","repos_url":"https://api.github.com/users/leancloud/repos","events_url":"https://api.github.com/users/leancloud/events{/privacy}","received_events_url":"https://api.github.com/users/leancloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/leancloud/docs","description":"LeanCloud Documentation","fork":false,"url":"https://api.github.com/repos/leancloud/docs","forks_url":"https://api.github.com/repos/leancloud/docs/forks","keys_url":"https://api.github.com/repos/leancloud/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leancloud/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leancloud/docs/teams","hooks_url":"https://api.github.com/repos/leancloud/docs/hooks","issue_events_url":"https://api.github.com/repos/leancloud/docs/issues/events{/number}","events_url":"https://api.github.com/repos/leancloud/docs/events","assignees_url":"https://api.github.com/repos/leancloud/docs/assignees{/user}","branches_url":"https://api.github.com/repos/leancloud/docs/branches{/branch}","tags_url":"https://api.github.com/repos/leancloud/docs/tags","blobs_url":"https://api.github.com/repos/leancloud/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leancloud/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leancloud/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/leancloud/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leancloud/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/leancloud/docs/languages","stargazers_url":"https://api.github.com/repos/leancloud/docs/stargazers","contributors_url":"https://api.github.com/repos/leancloud/docs/contributors","subscribers_url":"https://api.github.com/repos/leancloud/docs/subscribers","subscription_url":"https://api.github.com/repos/leancloud/docs/subscription","commits_url":"https://api.github.com/repos/leancloud/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/leancloud/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/leancloud/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/leancloud/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/leancloud/docs/contents/{+path}","compare_url":"https://api.github.com/repos/leancloud/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leancloud/docs/merges","archive_url":"https://api.github.com/repos/leancloud/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leancloud/docs/downloads","issues_url":"https://api.github.com/repos/leancloud/docs/issues{/number}","pulls_url":"https://api.github.com/repos/leancloud/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/leancloud/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/leancloud/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leancloud/docs/labels{/name}","releases_url":"https://api.github.com/repos/leancloud/docs/releases{/id}","created_at":"2014-10-11T07:14:37Z","updated_at":"2015-03-18T05:34:35Z","pushed_at":"2015-03-18T05:34:35Z","git_url":"git://github.com/leancloud/docs.git","ssh_url":"git@github.com:leancloud/docs.git","clone_url":"https://github.com/leancloud/docs.git","svn_url":"https://github.com/leancloud/docs","homepage":"http://leancloud.cn/docs/","size":19373,"stargazers_count":33,"watchers_count":33,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":12,"forks":34,"open_issues":12,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/leancloud/docs/pulls/137"},"html":{"href":"https://github.com/leancloud/docs/pull/137"},"issue":{"href":"https://api.github.com/repos/leancloud/docs/issues/137"},"comments":{"href":"https://api.github.com/repos/leancloud/docs/issues/137/comments"},"review_comments":{"href":"https://api.github.com/repos/leancloud/docs/pulls/137/comments"},"review_comment":{"href":"https://api.github.com/repos/leancloud/docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/leancloud/docs/pulls/137/commits"},"statuses":{"href":"https://api.github.com/repos/leancloud/docs/statuses/e1e32efa3c9bd650817ca8218a3751f2b1a97ec3"}}}}