{"action":"opened","issue":{"url":"https://api.github.com/repos/woshidasusu/Meizi/issues/1","repository_url":"https://api.github.com/repos/woshidasusu/Meizi","labels_url":"https://api.github.com/repos/woshidasusu/Meizi/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/woshidasusu/Meizi/issues/1/comments","events_url":"https://api.github.com/repos/woshidasusu/Meizi/issues/1/events","html_url":"https://github.com/woshidasusu/Meizi/issues/1","id":234760270,"number":1,"title":"Controller 构造函数问题","user":{"login":"blackmamba123","id":5058907,"avatar_url":"https://avatars3.githubusercontent.com/u/5058907?v=3","gravatar_id":"","url":"https://api.github.com/users/blackmamba123","html_url":"https://github.com/blackmamba123","followers_url":"https://api.github.com/users/blackmamba123/followers","following_url":"https://api.github.com/users/blackmamba123/following{/other_user}","gists_url":"https://api.github.com/users/blackmamba123/gists{/gist_id}","starred_url":"https://api.github.com/users/blackmamba123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackmamba123/subscriptions","organizations_url":"https://api.github.com/users/blackmamba123/orgs","repos_url":"https://api.github.com/users/blackmamba123/repos","events_url":"https://api.github.com/users/blackmamba123/events{/privacy}","received_events_url":"https://api.github.com/users/blackmamba123/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-09T08:44:01Z","updated_at":"2017-06-09T08:44:01Z","closed_at":null,"body":"看代码中 *** Controller应该是和某个Activity一一对应的 为什么构造函数传一个Context 然后做类型检查判断 ， 检查不是 抛异常 而不是直接把构造函数的参数设置为对应的Activity 这样直接强制满足这一要求吗？\r\nfor exampl：\r\npublic CategoryAController(Context context) {\r\n        if (!(context instanceof CategoryActivity)) {\r\n            LogUtils.e(TAG, TAG + \"绑定错误的Activity\");\r\n            throw new UnsupportedOperationException(TAG + \"绑定错误的Activity\");\r\n        }\r\n        mContext = context;\r\n        mCategoryActivity = (CategoryActivity) context;\r\n        initVariable();\r\n    }\r\n "}}
{"actor":{"display_login":"blackmamba123"}}