android - Toast.makeText()报错
伊谢尔伦
伊谢尔伦 2017-04-18 09:07:50
0
3
690

方法中第一个参数传application就会报错,改成Activity就不会报错,代码如下:

ProApplication代码如下:

报错如下:

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(3)
Ty80

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.

Ty80

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.

巴扎黑

Wang Zhengyi’s correct answer is that ProApplication.context is a null reference object.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template