Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MainActivity extends AppCompatActivity
- {
- EditText name, pass;
- @Override
- protected void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- name = findViewById(R.id.username);
- pass = findViewById(R.id.password);
- }
- public void login(View view){
- Intent intent = new Intent(MainActivity.this, Main2Activity.class);
- Bundle savedData = new Bundle();
- savedData.putString("Name", name.getText().toString());
- savedData.putInt("Password", Integer.parseInt(pass.getText().toString()));
- intent.putExtras(savedData);
- startActivity(intent);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment