安卓:发送和放大器;得到字符串除了使用额外的()方法 [英] android: send & get String besides by using extra() method
问题描述
我不知道用什么方法可以用来从一个到另一个活动送字符串除了使用intent.putExtra(),和getIntent.getExtra()。 因为我的项目得到意想不到的结果使用putExtra()时,只是想给他人发送的字符串。
I just wonder what method can be use to send String from one to another activity besides by using intent.putExtra(), and getIntent.getExtra(). Cause my project getting unexpected result when using putExtra(), just want to another for send String.
任何建议和例子?谢谢你。
Any suggestion and examples? Thanks.
推荐答案
您也可以发送通过以下方式
you can also send by following ways
非持久性对象
有关分担短时间复杂的非持久性用户定义的对象,则建议使用如下方法:
For sharing complex non-persistent user-defined objects for short duration, the following approaches are recommended:
-
Singleton类 - 参考这里:
一个公共静态字段/方法
A public static field/method
在WeakReferences的一个HashMap到对象
A HashMap of WeakReferences to Objects
这篇关于安卓:发送和放大器;得到字符串除了使用额外的()方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!