Skip to content

Instantly share code, notes, and snippets.

@LondonAppDev
Last active February 23, 2017 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LondonAppDev/ddccecdb3c2d7296bce37ca34e51188b to your computer and use it in GitHub Desktop.
Save LondonAppDev/ddccecdb3c2d7296bce37ca34e51188b to your computer and use it in GitHub Desktop.
1602 onCreate Method
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); // This is some magic for Android to load a previously saved state for when you are switching between actvities.
setContentView(R.layout.activity_main); // This links our code to our layout which we defined earlier.
this.etGitHubUser = (EditText) findViewById(R.id.et_github_user); // Link our github user text box.
this.btnGetRepos = (Button) findViewById(R.id.btn_get_repos); // Link our clicky button.
this.tvRepoList = (TextView) findViewById(R.id.tv_repo_list); // Link our repository list text output box.
this.tvRepoList.setMovementMethod(new ScrollingMovementMethod()); // This makes our text box scrollable, for those big GitHub contributors with lots of repos :)
requestQueue = Volley.newRequestQueue(this); // This setups up a new request queue which we will need to make HTTP requests.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment