开发者

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

开发者 https://www.devze.com 2022-12-30 10:55 出处:网络
How to p开发者_开发技巧ass a parameter to an application that I call from my Application?You\'re starting your other activity with an Intent. It should look similar to this code:

How to p开发者_开发技巧ass a parameter to an application that I call from my Application?


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 ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消