vinozly
将需要传输的数据封装在一个Bundle对象里,然后将该Bundle对象通过
fragment.setArguments()放到fragment内.
Bundle arguments = new Bundle();
arguments.putInt("int", 10);
Fragment fragment = new Fragment();
fragment.setArguments(arguments);
getFragmentManager().beginTransaction()
.replace(R.id.book_detail_container, fragment)
.commit();

在Fragment的回调函数内取出Bundle对象

Bundle bundle = getArguments();

分类:

技术点:

相关文章:

  • 2021-07-06
  • 2021-08-01
  • 2022-12-23
  • 2021-04-10
  • 2021-08-01
  • 2021-12-27
  • 2021-09-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
相关资源
相似解决方案