Get application context returns null

后端 未结 6 938
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 18:49

The following schema has been touted as the way to get application context from anywhere within my android app. But sometimes doing MyApp.getContext() returns n

6条回答
  •  清歌不尽
    2020-11-27 19:47

    Currently, you have not initialized instance and by default it's value would now be set to null. You need to assign it a value before you can use it.

提交回复
热议问题