图1
关于Context和其子类的传递

图2
关于Context和其子类的传递
看以上资料(图片),我们知道Activity 、FragmentActivity 和Application 都继承于Context,Fragment提供了getContext()方法,所以我们在没有特殊需要处理的情况下,封装工具类可以直接传context,不需要传子类

相关文章:

  • 2021-08-09
  • 2021-08-24
  • 2021-10-11
  • 2022-01-01
  • 2021-07-13
  • 2022-12-23
  • 2021-09-28
猜你喜欢
  • 2021-07-29
  • 2022-12-23
  • 2021-04-23
  • 2022-12-23
  • 2022-01-28
  • 2022-01-06
相关资源
相似解决方案