Skip to content

Instantly share code, notes, and snippets.

@gskielian
Created August 24, 2014 18:48
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 gskielian/c306080f8e76b6cfcfc9 to your computer and use it in GitHub Desktop.
Save gskielian/c306080f8e76b6cfcfc9 to your computer and use it in GitHub Desktop.
package com.example.a1_awesome_intents;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button doStuffButton = (Button) findViewById(R.id.do_stuff_button);
//remember lowerCamelCase for buttons
doStuffButton.setOnClickListener(new View.OnClickListener() {
//here we send the user to the next activity
@Override
public void onClick(View view) {
//do stuff here
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment