安卓:什么是捆绑VS java.util中的集合类似的HashMap的区别 [英] Android: what is the difference between Bundle Vs java.util collections like HashMap

查看:123
本文介绍了安卓:什么是捆绑VS java.util中的集合类似的HashMap的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

java.util中像HashMap的?

What is the difference between Bundle Vs java.util collections like HashMap?

推荐答案

一个区别,我可以很容易地看到的是,一个包可以让你把整型,布尔型,等等,把它当一个HashMap似乎要求你将它们转换到/从对象

One difference I can see easily is that a Bundle allows you to put int, boolean, etc., into it while a HashMap seems to require you to convert them to/from objects.

有一个更重要的区别是,一个包,每个对象包含的parcelable。这使得束被用作服务参数,也可以附连到意图/传递到活动

A more important difference is that with a Bundle, every object it contains is parcelable. This allows Bundles to be used as service parameters and to be attached to intents / passed into activities.

这篇关于安卓:什么是捆绑VS java.util中的集合类似的HashMap的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆