NullPointerException trying to access a String resource

后端 未结 3 981
耶瑟儿~
耶瑟儿~ 2021-01-18 07:56

I have the following /res/values/uris.xml



blahblah         


        
3条回答
  •  有刺的猬
    2021-01-18 08:31

    First, make sure these values are in the file strings.xml.

    Also, you can't access the strings from the constructor. The application context is not yet initialized. You should do it in onCreate().

    Emmanuel

提交回复
热议问题