Created
December 18, 2016 21:38
-
-
Save ageorg/4edfdcc1c673fb2db24c27263d7fdf9b to your computer and use it in GitHub Desktop.
creating an Intent with extra information
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
nameEditText = (EditText) findViewById(R.id.editText); | |
Button nextBtn = (Button) findViewById(R.id.btn_next); | |
nextBtn.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
Intent i = new Intent(MainActivity.this, Main2Activity.class); | |
String nameStr = nameEditText.getText().toString(); | |
i.putExtra(TAG_NAME, nameStr); | |
startActivity(i); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment