Last active
July 4, 2018 17:36
-
-
Save jhonkaman/3191eebc70b72ff1a9b2e791c58868f0 to your computer and use it in GitHub Desktop.
Android: Using an intent to launch a second activity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
} | |
/* Relevant Code */ | |
public void onClick(View view) { | |
// Instantiate an Intent object | |
Intent intent = new Intent(this, SecondActivity.class); | |
// Start the new activity | |
startActivity(intent); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment