{"action":"opened","number":69,"pull_request":{"url":"https://api.github.com/repos/fastlane/screengrab/pulls/69","id":59305857,"html_url":"https://github.com/fastlane/screengrab/pull/69","diff_url":"https://github.com/fastlane/screengrab/pull/69.diff","patch_url":"https://github.com/fastlane/screengrab/pull/69.patch","issue_url":"https://api.github.com/repos/fastlane/screengrab/issues/69","number":69,"state":"open","locked":false,"title":"Get Activity of a View if the Context is a ContextWrapper","user":{"login":"scompt","id":277576,"avatar_url":"https://avatars.githubusercontent.com/u/277576?v=3","gravatar_id":"","url":"https://api.github.com/users/scompt","html_url":"https://github.com/scompt","followers_url":"https://api.github.com/users/scompt/followers","following_url":"https://api.github.com/users/scompt/following{/other_user}","gists_url":"https://api.github.com/users/scompt/gists{/gist_id}","starred_url":"https://api.github.com/users/scompt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scompt/subscriptions","organizations_url":"https://api.github.com/users/scompt/orgs","repos_url":"https://api.github.com/users/scompt/repos","events_url":"https://api.github.com/users/scompt/events{/privacy}","received_events_url":"https://api.github.com/users/scompt/received_events","type":"User","site_admin":false},"body":"In some cases calling View.getContext will return a ContextWrapper instead\r\nof an Activity. This will cause a ClassCastException:\r\n\r\n```\r\njava.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity\r\nat tools.fastlane.screengrab.Screengrab$1.perform(Screengrab.java:77)\r\n```\r\n\r\nThe added code is based on [this Stackoverflow answer](http://stackoverflow.com/a/27434760/111777).","created_at":"2016-02-14T21:03:49Z","updated_at":"2016-02-14T21:03:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fastlane/screengrab/pulls/69/commits","review_comments_url":"https://api.github.com/repos/fastlane/screengrab/pulls/69/comments","review_comment_url":"https://api.github.com/repos/fastlane/screengrab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastlane/screengrab/issues/69/comments","statuses_url":"https://api.github.com/repos/fastlane/screengrab/statuses/c192653bea97e6b6a298db88845bdc8ee75eae47","head":{"label":"scompt:context_wrapper","ref":"context_wrapper","sha":"c192653bea97e6b6a298db88845bdc8ee75eae47","user":{"login":"scompt","id":277576,"avatar_url":"https://avatars.githubusercontent.com/u/277576?v=3","gravatar_id":"","url":"https://api.github.com/users/scompt","html_url":"https://github.com/scompt","followers_url":"https://api.github.com/users/scompt/followers","following_url":"https://api.github.com/users/scompt/following{/other_user}","gists_url":"https://api.github.com/users/scompt/gists{/gist_id}","starred_url":"https://api.github.com/users/scompt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scompt/subscriptions","organizations_url":"https://api.github.com/users/scompt/orgs","repos_url":"https://api.github.com/users/scompt/repos","events_url":"https://api.github.com/users/scompt/events{/privacy}","received_events_url":"https://api.github.com/users/scompt/received_events","type":"User","site_admin":false},"repo":{"id":51712625,"name":"screengrab","full_name":"scompt/screengrab","owner":{"login":"scompt","id":277576,"avatar_url":"https://avatars.githubusercontent.com/u/277576?v=3","gravatar_id":"","url":"https://api.github.com/users/scompt","html_url":"https://github.com/scompt","followers_url":"https://api.github.com/users/scompt/followers","following_url":"https://api.github.com/users/scompt/following{/other_user}","gists_url":"https://api.github.com/users/scompt/gists{/gist_id}","starred_url":"https://api.github.com/users/scompt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scompt/subscriptions","organizations_url":"https://api.github.com/users/scompt/orgs","repos_url":"https://api.github.com/users/scompt/repos","events_url":"https://api.github.com/users/scompt/events{/privacy}","received_events_url":"https://api.github.com/users/scompt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scompt/screengrab","description":"Automated localized screenshots of your Android app on every device","fork":true,"url":"https://api.github.com/repos/scompt/screengrab","forks_url":"https://api.github.com/repos/scompt/screengrab/forks","keys_url":"https://api.github.com/repos/scompt/screengrab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scompt/screengrab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scompt/screengrab/teams","hooks_url":"https://api.github.com/repos/scompt/screengrab/hooks","issue_events_url":"https://api.github.com/repos/scompt/screengrab/issues/events{/number}","events_url":"https://api.github.com/repos/scompt/screengrab/events","assignees_url":"https://api.github.com/repos/scompt/screengrab/assignees{/user}","branches_url":"https://api.github.com/repos/scompt/screengrab/branches{/branch}","tags_url":"https://api.github.com/repos/scompt/screengrab/tags","blobs_url":"https://api.github.com/repos/scompt/screengrab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scompt/screengrab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scompt/screengrab/git/refs{/sha}","trees_url":"https://api.github.com/repos/scompt/screengrab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scompt/screengrab/statuses/{sha}","languages_url":"https://api.github.com/repos/scompt/screengrab/languages","stargazers_url":"https://api.github.com/repos/scompt/screengrab/stargazers","contributors_url":"https://api.github.com/repos/scompt/screengrab/contributors","subscribers_url":"https://api.github.com/repos/scompt/screengrab/subscribers","subscription_url":"https://api.github.com/repos/scompt/screengrab/subscription","commits_url":"https://api.github.com/repos/scompt/screengrab/commits{/sha}","git_commits_url":"https://api.github.com/repos/scompt/screengrab/git/commits{/sha}","comments_url":"https://api.github.com/repos/scompt/screengrab/comments{/number}","issue_comment_url":"https://api.github.com/repos/scompt/screengrab/issues/comments{/number}","contents_url":"https://api.github.com/repos/scompt/screengrab/contents/{+path}","compare_url":"https://api.github.com/repos/scompt/screengrab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scompt/screengrab/merges","archive_url":"https://api.github.com/repos/scompt/screengrab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scompt/screengrab/downloads","issues_url":"https://api.github.com/repos/scompt/screengrab/issues{/number}","pulls_url":"https://api.github.com/repos/scompt/screengrab/pulls{/number}","milestones_url":"https://api.github.com/repos/scompt/screengrab/milestones{/number}","notifications_url":"https://api.github.com/repos/scompt/screengrab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scompt/screengrab/labels{/name}","releases_url":"https://api.github.com/repos/scompt/screengrab/releases{/id}","deployments_url":"https://api.github.com/repos/scompt/screengrab/deployments","created_at":"2016-02-14T20:44:51Z","updated_at":"2016-02-14T20:44:52Z","pushed_at":"2016-02-14T21:03:18Z","git_url":"git://github.com/scompt/screengrab.git","ssh_url":"git@github.com:scompt/screengrab.git","clone_url":"https://github.com/scompt/screengrab.git","svn_url":"https://github.com/scompt/screengrab","homepage":"https://fastlane.tools","size":2634,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"fastlane:master","ref":"master","sha":"be0c48b90f4d2457bb38da2334755b401c70d15c","user":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"repo":{"id":48058682,"name":"screengrab","full_name":"fastlane/screengrab","owner":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fastlane/screengrab","description":"Automated localized screenshots of your Android app on every device","fork":false,"url":"https://api.github.com/repos/fastlane/screengrab","forks_url":"https://api.github.com/repos/fastlane/screengrab/forks","keys_url":"https://api.github.com/repos/fastlane/screengrab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastlane/screengrab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastlane/screengrab/teams","hooks_url":"https://api.github.com/repos/fastlane/screengrab/hooks","issue_events_url":"https://api.github.com/repos/fastlane/screengrab/issues/events{/number}","events_url":"https://api.github.com/repos/fastlane/screengrab/events","assignees_url":"https://api.github.com/repos/fastlane/screengrab/assignees{/user}","branches_url":"https://api.github.com/repos/fastlane/screengrab/branches{/branch}","tags_url":"https://api.github.com/repos/fastlane/screengrab/tags","blobs_url":"https://api.github.com/repos/fastlane/screengrab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastlane/screengrab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastlane/screengrab/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastlane/screengrab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastlane/screengrab/statuses/{sha}","languages_url":"https://api.github.com/repos/fastlane/screengrab/languages","stargazers_url":"https://api.github.com/repos/fastlane/screengrab/stargazers","contributors_url":"https://api.github.com/repos/fastlane/screengrab/contributors","subscribers_url":"https://api.github.com/repos/fastlane/screengrab/subscribers","subscription_url":"https://api.github.com/repos/fastlane/screengrab/subscription","commits_url":"https://api.github.com/repos/fastlane/screengrab/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastlane/screengrab/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastlane/screengrab/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastlane/screengrab/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastlane/screengrab/contents/{+path}","compare_url":"https://api.github.com/repos/fastlane/screengrab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastlane/screengrab/merges","archive_url":"https://api.github.com/repos/fastlane/screengrab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastlane/screengrab/downloads","issues_url":"https://api.github.com/repos/fastlane/screengrab/issues{/number}","pulls_url":"https://api.github.com/repos/fastlane/screengrab/pulls{/number}","milestones_url":"https://api.github.com/repos/fastlane/screengrab/milestones{/number}","notifications_url":"https://api.github.com/repos/fastlane/screengrab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastlane/screengrab/labels{/name}","releases_url":"https://api.github.com/repos/fastlane/screengrab/releases{/id}","deployments_url":"https://api.github.com/repos/fastlane/screengrab/deployments","created_at":"2015-12-15T17:32:27Z","updated_at":"2016-02-14T20:38:16Z","pushed_at":"2016-02-12T18:53:23Z","git_url":"git://github.com/fastlane/screengrab.git","ssh_url":"git@github.com:fastlane/screengrab.git","clone_url":"https://github.com/fastlane/screengrab.git","svn_url":"https://github.com/fastlane/screengrab","homepage":"https://fastlane.tools","size":2632,"stargazers_count":418,"watchers_count":418,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":1,"forks":23,"open_issues":1,"watchers":418,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastlane/screengrab/pulls/69"},"html":{"href":"https://github.com/fastlane/screengrab/pull/69"},"issue":{"href":"https://api.github.com/repos/fastlane/screengrab/issues/69"},"comments":{"href":"https://api.github.com/repos/fastlane/screengrab/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/fastlane/screengrab/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/fastlane/screengrab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastlane/screengrab/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/fastlane/screengrab/statuses/c192653bea97e6b6a298db88845bdc8ee75eae47"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":20,"deletions":1,"changed_files":1}}