當前位置:編程學習大全網 - 網站源碼 - 如何在Service中獲得Context

如何在Service中獲得Context

這個問題占看還有些混人,getContext()和getBaseContext()都不行,後來發現,Service的繼承關系為:java.lang.Object android.context.Context android.context.ContextWrapper android.app.Service即它本身就是壹個Context,那麽就只要直接This就可以了

  • 上一篇:微信朋友圈怎麽做廣告推廣?
  • 下一篇:芯片區域源代碼
  • copyright 2024編程學習大全網