Android的 - 我可以传递参数时,启动从我的应用程序的其他应用程序? [英] Android - can I pass a parameter when launch other applications from my application?
本文介绍了Android的 - 我可以传递参数时,启动从我的应用程序的其他应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将参数传递给我从我的应用程序调用的应用程序?
How to pass a parameter to an application that I call from my Application?
推荐答案
您已经开始您的其他活动,意图。它看起来应该与此类似code:
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);
然后你可以添加一行code来传递参数(如字符串):
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 ;)
这篇关于Android的 - 我可以传递参数时,启动从我的应用程序的其他应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文