Crash
yaojunyi3721 opened this issue · 4 comments
华为 P6 S-U06
Android 4.4.2,level 19
DropDownMenu:v0.9
compileSdkVersion 25
buildToolsVersion "25.0.2"
minSdkVersion 15
targetSdkVersion 25
多个menucount时会在DropDownMenu.onDraw(DropDownMenu.java:243)抛出NullPointerException
已排除其他原因
确定和手机以及menucount有关
就是在super.onDraw(canvas)里出的错 canvas本身并不为null
出错堆栈
1 android.view.GLES20Canvas.setupModifiers(GLES20Canvas.java:1439)
2 android.view.GLES20Canvas.drawLines(GLES20Canvas.java:1019)
3 android.view.GLES20Canvas.drawLine(GLES20Canvas.java:1009)
4 android.graphics.drawable.GradientDrawable.draw(GradientDrawable.java:538)
5 android.widget.LinearLayout.drawVerticalDivider(LinearLayout.java:417)
6 android.widget.LinearLayout.drawDividersHorizontal(LinearLayout.java:381)
7 android.widget.LinearLayout.onDraw(LinearLayout.java:321)
8 com.jayfang.dropdownmenu.DropDownMenu.onDraw(DropDownMenu.java:243)
9 android.view.View.draw(View.java:14522)
10 android.view.View.getDisplayList(View.java:13406)
11 android.view.View.getDisplayList(View.java:13448)
12 android.view.View.draw(View.java:14239)
13 android.view.ViewGroup.drawChild(ViewGroup.java:3121)
14 android.view.ViewGroup.dispatchDraw(ViewGroup.java:2947)
15 android.view.View.draw(View.java:14525)
16 android.view.View.getDisplayList(View.java:13406)
17 android.view.View.getDisplayList(View.java:13448)
18 android.view.View.draw(View.java:14239)
19 android.view.ViewGroup.drawChild(ViewGroup.java:3121)
20 android.view.ViewGroup.dispatchDraw(ViewGroup.java:2947)
我这使用场景是viewpager+3个fragment
每个Fragment都有dropdownmenu
我从这里找到了答案
https://issuetracker.google.com/issues/37058329
试试看是否管用
解决不了 最后调高minSdkVersion到21 放弃对Android4.4及以下版本的支持