简体   繁体   English

如何在Android中窥视Intent Extras

[英]How to peek into Intent Extras in Android

I have an application that starts Activity with extras. 我有一个使用Extras启动Activity的应用程序。 I would like to see what extras are inside Intent. 我想看看Intent有什么附加功能。 Both applications (calling and called) are not written by me. 这两个应用程序(调用和被调用)都不是我编写的。

Send the data first: 首先发送数据:

Intent i = new Intent(YourActivity.class);
i.putExtra("parameter", yourData)
startActivity(i);

To get the data : 要获取数据:

Intent i = getIntent();
String data = i.getStringExtra("parameter"); //you can do for integer, etc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM