PopupWindows 在2.3.3下报java.lang.NullPointerException

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
03-05 01:20:56.040: E/AndroidRuntime(1396): java.lang.NullPointerException
03-05 01:20:56.040: E/AndroidRuntime(1396):     at android.widget.PopupWindow.setContentView(PopupWindow.java:384)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at android.widget.PopupWindow.<init>(PopupWindow.java:286)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at android.widget.PopupWindow.<init>(PopupWindow.java:266)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at android.widget.PopupWindow.<init>(PopupWindow.java:223
03-05 01:20:56.040: E/AndroidRuntime(1396):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at android.os.Handler.handleCallback(Handler.java:587)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at android.os.Handler.dispatchMessage(Handler.java:92)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at android.os.Looper.loop(Looper.java:130)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at android.app.ActivityThread.main(ActivityThread.java:3683)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at java.lang.reflect.Method.invokeNative(Native Method)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at java.lang.reflect.Method.invoke(Method.java:507)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-05 01:20:56.040: E/AndroidRuntime(1396):     at dalvik.system.NativeStart.main(Native Method)

  以上是错误信息

在重写PopupWindows的时候记得加上super(context);就行了

4.0以上不会出现这个问题

PopupWindows 在2.3.3下报java.lang.NullPointerException,布布扣,bubuko.com

PopupWindows 在2.3.3下报java.lang.NullPointerException

上一篇:Illustrator(AI)利用多边形工具设计打造质感素材图片实例教程


下一篇:教你用Fireworks手绘超级女声厉娜