两者本质上没有任何区别。
Bundle只是一个信息的载体 将内部的内容以键值对组织 
Intent负责Activity之间的交互 自己是带有一个Bundle的
Intent.putExtras(Bundle bundle)直接将Intent的内部Bundle设置为参数里的bundle
Intent.getExtras()直接可以获取Intent带有的Bundle

intent.putExtra(key, value)

Bundle bundle = intent.getExtras();
bundle.putXXX(key, value);
intent.putExtras(bundle);
是等价的

intent.getXXXExtra(key)

Bundle bundle = intent.getExtras();
bundle .getXXX(key);
是等价的(XXX代表数据/对象类型 String boolean 什么的)

相关文章:

  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2021-07-06
猜你喜欢
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2021-12-10
  • 2022-12-23
  • 2021-06-06
相关资源
相似解决方案