Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - can I pass a parameter when launch other applications from my application?

How to pass a parameter to an application that I call from my Application?

like image 487
army Avatar asked May 14 '10 08:05

army


1 Answers

You're starting your other activity with an Intent. It should look similar to this code:

Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
startActivity(intent);

Then you can add a line of code to pass parameters (e.g. Strings):

intent.putExtras("key", "value");

Note: you should add this line before starting the activity ;)

like image 97
RoflcoptrException Avatar answered Oct 14 '22 13:10

RoflcoptrException