activity 之间值传递
2016-06-11 11:55
183 查看
如何在activity之间传递对象
- 传递端
Intent intent = new Intent(); intent.setClass(Login.this, MainActivity.class); Bundle bundle = new Bundle(); bundle.putSerializable("user", user); intent.putExtras(bundle); this.startActivity(intent);
- 接收端
Intent intent = this.getIntent(); user=(User)intent.getSerializableExtra("user");
- 将传递的类对象继承序列化
相关文章推荐
- Activity之间传递数据
- Android 两个Activity之间传递数据及返回
- Android中两个Activity之间数据传递及返回
- Android 学习之Activity与Fragment之间的信息传递
- 【Android开发小记--1】Activity之间传递信息
- Android中Activity之间数据传递及返回
- Activity之间传递类对象(Parcelable)
- Android入门篇五:使用全局变量在Activity之间传递数据
- 利用Bundle在activity之间传递对象
- Activity页面之间数据传递
- activity之间如何传递list
- Android之Activity之间传递对象
- Android基础 -- Activity之间传递数据(bitmap和map对象)
- android之在activity中控制另一个activity的UI更新_如何在activity之间传递handler
- activity之间传递对象
- Android中Activity之间跳转和参数传递的实例
- 在activity之间传递handler(一)
- Android开发笔记---不同activity之间的数据传递
- Activity 和 Fragment 之间的数据传递
- Android学习—Activity之间数据传递之Intent数据传递