{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/react-native/pulls/comments/47828481","id":47828481,"diff_hunk":"@@ -0,0 +1,194 @@\n+package com.facebook.react;\n+\n+import android.app.Activity;\n+import android.content.Intent;\n+import android.os.Build;\n+import android.os.Bundle;\n+import android.os.Handler;\n+import android.provider.Settings;\n+import android.view.KeyEvent;\n+import android.widget.EditText;\n+import android.widget.Toast;\n+\n+import com.facebook.common.logging.FLog;\n+import com.facebook.react.common.ReactConstants;\n+import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;\n+import com.facebook.react.shell.MainReactPackage;\n+\n+import javax.annotation.Nullable;\n+\n+/**\n+ * Base Activity for React Native applications.\n+ */\n+public abstract class ReactActivity extends Activity implements DefaultHardwareBackBtnHandler {\n+\n+    private static final String REDBOX_PERMISSION_MESSAGE =\n+            \"Overlay permissions needs to be granted in order for react native apps to run in dev mode\";\n+\n+    private @Nullable ReactInstanceManager mReactInstanceManager;\n+    private LifecycleState mLifecycleState = LifecycleState.BEFORE_RESUME;\n+    private boolean mDoRefresh = false;\n+\n+    /**\n+     * @return the name of the bundle in assets. If this is null, the app will only work with dev\n+     * support on and will always try to load the JS bundle from the packager server.\n+     * eg. \"index.android.bundle\"\n+     */\n+    protected abstract @Nullable String getBundleAssetName();\n+\n+    /**\n+     * @return the path of the bundle file, if the bundle needs to be loaded from custom path\n+     */\n+    protected abstract @Nullable String getJSBundleFile();\n+\n+    /**\n+     * @return the name of the main module. This is used to determine the URL to fetch the JS bundle\n+     * from the packager server and is only used when dev support is enabled.\n+     * This is the first file to be executed once the {@code ReactInstanceManager} is created.\n+     * eg. \"RKJSModules/Apps/Airbourne/AirbourneAppBundle\"\n+     */\n+    protected abstract String getJSMainModuleName();\n+\n+    /**\n+     * @return the name of the main component registered from JavaScript. This is used to schedule\n+     * rendering of the component\n+     */\n+    protected abstract String getMainComponentName();","path":"ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java","position":56,"original_position":56,"commit_id":"99871af2dc700883a222de12471ee237e35951e5","original_commit_id":"99871af2dc700883a222de12471ee237e35951e5","user":{"login":"mkonicek","id":346214,"avatar_url":"https://avatars.githubusercontent.com/u/346214?v=3","gravatar_id":"","url":"https://api.github.com/users/mkonicek","html_url":"https://github.com/mkonicek","followers_url":"https://api.github.com/users/mkonicek/followers","following_url":"https://api.github.com/users/mkonicek/following{/other_user}","gists_url":"https://api.github.com/users/mkonicek/gists{/gist_id}","starred_url":"https://api.github.com/users/mkonicek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkonicek/subscriptions","organizations_url":"https://api.github.com/users/mkonicek/orgs","repos_url":"https://api.github.com/users/mkonicek/repos","events_url":"https://api.github.com/users/mkonicek/events{/privacy}","received_events_url":"https://api.github.com/users/mkonicek/received_events","type":"User","site_admin":false},"body":"This is technically a module name, see https://github.com/facebook/react-native/blob/7377fdcc70b25eb023e7c6d1b37eeae2a700cb88/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java#L321\r\n\r\nAn example is \"MoviesApp\". Can you add the example here please?","created_at":"2015-12-16T20:21:16Z","updated_at":"2015-12-16T20:21:16Z","html_url":"https://github.com/facebook/react-native/pull/4827#discussion_r47828481","pull_request_url":"https://api.github.com/repos/facebook/react-native/pulls/4827","_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments/47828481"},"html":{"href":"https://github.com/facebook/react-native/pull/4827#discussion_r47828481"},"pull_request":{"href":"https://api.github.com/repos/facebook/react-native/pulls/4827"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/4827","id":53869039,"html_url":"https://github.com/facebook/react-native/pull/4827","diff_url":"https://github.com/facebook/react-native/pull/4827.diff","patch_url":"https://github.com/facebook/react-native/pull/4827.patch","issue_url":"https://api.github.com/repos/facebook/react-native/issues/4827","number":4827,"state":"open","locked":false,"title":"Add a base activity for React Native apps","user":{"login":"satya164","id":1174278,"avatar_url":"https://avatars.githubusercontent.com/u/1174278?v=3","gravatar_id":"","url":"https://api.github.com/users/satya164","html_url":"https://github.com/satya164","followers_url":"https://api.github.com/users/satya164/followers","following_url":"https://api.github.com/users/satya164/following{/other_user}","gists_url":"https://api.github.com/users/satya164/gists{/gist_id}","starred_url":"https://api.github.com/users/satya164/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satya164/subscriptions","organizations_url":"https://api.github.com/users/satya164/orgs","repos_url":"https://api.github.com/users/satya164/repos","events_url":"https://api.github.com/users/satya164/events{/privacy}","received_events_url":"https://api.github.com/users/satya164/received_events","type":"User","site_admin":false},"body":"Having a base activity allows us to add new features and fixes without having to change the generated `MainActivity` file.\r\n\r\ncc @mkonicek @arbesfeld ","created_at":"2015-12-16T17:03:07Z","updated_at":"2015-12-16T20:21:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb5d7733c86c3d9f2d72b58415e62ff0526a5cd0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react-native/pulls/4827/commits","review_comments_url":"https://api.github.com/repos/facebook/react-native/pulls/4827/comments","review_comment_url":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/4827/comments","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/99871af2dc700883a222de12471ee237e35951e5","head":{"label":"satya164:base-activity","ref":"base-activity","sha":"99871af2dc700883a222de12471ee237e35951e5","user":{"login":"satya164","id":1174278,"avatar_url":"https://avatars.githubusercontent.com/u/1174278?v=3","gravatar_id":"","url":"https://api.github.com/users/satya164","html_url":"https://github.com/satya164","followers_url":"https://api.github.com/users/satya164/followers","following_url":"https://api.github.com/users/satya164/following{/other_user}","gists_url":"https://api.github.com/users/satya164/gists{/gist_id}","starred_url":"https://api.github.com/users/satya164/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satya164/subscriptions","organizations_url":"https://api.github.com/users/satya164/orgs","repos_url":"https://api.github.com/users/satya164/repos","events_url":"https://api.github.com/users/satya164/events{/privacy}","received_events_url":"https://api.github.com/users/satya164/received_events","type":"User","site_admin":false},"repo":{"id":42726415,"name":"react-native","full_name":"satya164/react-native","owner":{"login":"satya164","id":1174278,"avatar_url":"https://avatars.githubusercontent.com/u/1174278?v=3","gravatar_id":"","url":"https://api.github.com/users/satya164","html_url":"https://github.com/satya164","followers_url":"https://api.github.com/users/satya164/followers","following_url":"https://api.github.com/users/satya164/following{/other_user}","gists_url":"https://api.github.com/users/satya164/gists{/gist_id}","starred_url":"https://api.github.com/users/satya164/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satya164/subscriptions","organizations_url":"https://api.github.com/users/satya164/orgs","repos_url":"https://api.github.com/users/satya164/repos","events_url":"https://api.github.com/users/satya164/events{/privacy}","received_events_url":"https://api.github.com/users/satya164/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/satya164/react-native","description":"A framework for building native apps with React.","fork":true,"url":"https://api.github.com/repos/satya164/react-native","forks_url":"https://api.github.com/repos/satya164/react-native/forks","keys_url":"https://api.github.com/repos/satya164/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/satya164/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/satya164/react-native/teams","hooks_url":"https://api.github.com/repos/satya164/react-native/hooks","issue_events_url":"https://api.github.com/repos/satya164/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/satya164/react-native/events","assignees_url":"https://api.github.com/repos/satya164/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/satya164/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/satya164/react-native/tags","blobs_url":"https://api.github.com/repos/satya164/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/satya164/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/satya164/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/satya164/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/satya164/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/satya164/react-native/languages","stargazers_url":"https://api.github.com/repos/satya164/react-native/stargazers","contributors_url":"https://api.github.com/repos/satya164/react-native/contributors","subscribers_url":"https://api.github.com/repos/satya164/react-native/subscribers","subscription_url":"https://api.github.com/repos/satya164/react-native/subscription","commits_url":"https://api.github.com/repos/satya164/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/satya164/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/satya164/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/satya164/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/satya164/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/satya164/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/satya164/react-native/merges","archive_url":"https://api.github.com/repos/satya164/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/satya164/react-native/downloads","issues_url":"https://api.github.com/repos/satya164/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/satya164/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/satya164/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/satya164/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/satya164/react-native/labels{/name}","releases_url":"https://api.github.com/repos/satya164/react-native/releases{/id}","created_at":"2015-09-18T14:14:48Z","updated_at":"2015-09-18T14:14:51Z","pushed_at":"2015-12-16T17:39:15Z","git_url":"git://github.com/satya164/react-native.git","ssh_url":"git@github.com:satya164/react-native.git","clone_url":"https://github.com/satya164/react-native.git","svn_url":"https://github.com/satya164/react-native","homepage":"http://facebook.github.io/react-native/","size":32734,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"e5e846ab0afbb63546da53618ac3f0a206175a15","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":29028775,"name":"react-native","full_name":"facebook/react-native","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/react-native","description":"A framework for building native apps with React.","fork":false,"url":"https://api.github.com/repos/facebook/react-native","forks_url":"https://api.github.com/repos/facebook/react-native/forks","keys_url":"https://api.github.com/repos/facebook/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react-native/teams","hooks_url":"https://api.github.com/repos/facebook/react-native/hooks","issue_events_url":"https://api.github.com/repos/facebook/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react-native/events","assignees_url":"https://api.github.com/repos/facebook/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react-native/tags","blobs_url":"https://api.github.com/repos/facebook/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react-native/languages","stargazers_url":"https://api.github.com/repos/facebook/react-native/stargazers","contributors_url":"https://api.github.com/repos/facebook/react-native/contributors","subscribers_url":"https://api.github.com/repos/facebook/react-native/subscribers","subscription_url":"https://api.github.com/repos/facebook/react-native/subscription","commits_url":"https://api.github.com/repos/facebook/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react-native/merges","archive_url":"https://api.github.com/repos/facebook/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react-native/downloads","issues_url":"https://api.github.com/repos/facebook/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react-native/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react-native/releases{/id}","created_at":"2015-01-09T18:10:16Z","updated_at":"2015-12-16T20:14:47Z","pushed_at":"2015-12-16T20:15:36Z","git_url":"git://github.com/facebook/react-native.git","ssh_url":"git@github.com:facebook/react-native.git","clone_url":"https://github.com/facebook/react-native.git","svn_url":"https://github.com/facebook/react-native","homepage":"http://facebook.github.io/react-native/","size":66012,"stargazers_count":24004,"watchers_count":24004,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3987,"mirror_url":null,"open_issues_count":1082,"forks":3987,"open_issues":1082,"watchers":24004,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/4827"},"html":{"href":"https://github.com/facebook/react-native/pull/4827"},"issue":{"href":"https://api.github.com/repos/facebook/react-native/issues/4827"},"comments":{"href":"https://api.github.com/repos/facebook/react-native/issues/4827/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react-native/pulls/4827/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react-native/pulls/4827/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react-native/statuses/99871af2dc700883a222de12471ee237e35951e5"}}}}