我有一个服务器上运行,通知与打开我的主要活性状态栏通知用户,我怎么可以将数据传递给我的活动低谷意图是什么?
I have a server running that notifies the user with a statusbar notification that opens my main activity, how can I pass data to my activity trough that intent?
使用Intent.putExtra(..):
intent.putExtra("keyName", "somevalue");
此方法重载,需要各种类型的第二个参数:INT,字节,字符串,在不同的阵列。
This method is overloaded and takes various types as second argument: int, byte, String, various arrays..
要获取数据使用适当的getXYZExtra()。对于字符串,这是:
To get the data out use appropriate getXYZExtra(). For String this is:
getStringExtra(String keyName)