android登录跳转的时候怎么传值?

fghnn 2012-05-07 11:07:56
比如注登录的时候获取了用户信息,下个activity需要调用
是存到一个对象里,是把这个对象用static保存起来?还是装到intent传值?
也不一定是登录,就是类似这种跳转activity获取值的方法
...全文
222 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
soft200816 2012-05-15
  • 打赏
  • 举报
回复
经常要用到的数据放在application中还是比较方便的,传来传去也会影响系统的性能!
soft200816 2012-05-15
  • 打赏
  • 举报
回复
经常要用到的数据放在application中还是比较方便的,传来传去也会影响系统的性能!
fghnn 2012-05-07
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 的回复:]

不同思路:可以在Application里设置变量,在activity中获取。犹如全局变量。
[/Quote]
谢谢,这个在获取bitmap的时候也用过了
msgsnd 2012-05-07
  • 打赏
  • 举报
回复
不同思路:可以在Application里设置变量,在activity中获取。犹如全局变量。
fghnn 2012-05-07
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

Intent intent = new Intent();
Bundle bundle= new Bundle();
bundle.putSerializable(key, value);
intent.putExtra(name, bundle);
你那个对象要先序列化!
[/Quote]

谢谢回复,我知道具体做法,只是想求不同思路
ganzi01234 2012-05-07
  • 打赏
  • 举报
回复
同意楼上
JavPer 2012-05-07
  • 打赏
  • 举报
回复
Intent intent = new Intent();
Bundle bundle= new Bundle();
bundle.putSerializable(key, value);
intent.putExtra(name, bundle);
你那个对象要先序列化!
儿大不由爷 2012-05-07
  • 打赏
  • 举报
回复
你不会要在activity中保存吧,可以做个类,singleton模式的。

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧