I want to pass two values to another activity can I do this with putExtra or do I have to do it a more complicated way, which it seems from my reading. E.g.. can something l
You could pass a 'bundle' of extras rather than individual extras if you like, for example:-
Intent intent = new Intent(this, MyActivity.class);
Bundle extras = new Bundle();
extras.putString("EXTRA_USERNAME","my_username");
extras.putString("EXTRA_PASSWORD","my_password");
intent.putExtras(extras);
startActivity(intent);
Then in your Activity that your triggering, you can reference these like so:-
Intent intent = getIntent();
Bundle extras = intent.getExtras();
String username_string = extras.getString("EXTRA_USERNAME");
String password_string = extras.getString("EXTRA_PASSWORD");
Or (if you prefer):-
Bundle extras = getIntent().getExtras();
String username_string = extras.getString("EXTRA_USERNAME");
String password_string = extras.getString("EXTRA_PASSWORD");
Hope this helps! :-)