方法中第一个参数传application就会报错,改成Activity就不会报错,代码如下:
ProApplication代码如下:
报错如下:
PHP中文网2017-04-18 09:09:50
Is your ProApplication declared in AndroidManifest.xml?
From the log, it is obvious that the Application tag in your AndroidManifest.xml does not specify your ProApplication, causing the context to be null.
PHP中文网2017-04-18 09:09:50
The log only shows that the context you passed in is null. Specifically, you can debug and set the endpoint to see if there is any problem with the incoming.
巴扎黑2017-04-18 09:09:50
Wang Zhengyi’s correct answer is that ProApplication.context is a null reference object.