安卓开发 Android Cookie

Android 安卓是最开放的手机操作系统,谷歌安卓APP开发和安卓市场的相关话题

onMeasure()中的子项的空指针exception:futuresimple / floating-action-button

使用Android浮动操作按钮Lib 我在xml文件中创建了浮动操作菜单,并在此浮动操作菜单下创建了动态浮动操作按钮。 我在每个FAB上设置图像位图。 在某些特定情况下,我必须删除浮动操作菜单下的所有按钮。 但是在removeView()方法上,当我试图在onMeasure()方法中获得子对象的可见性时,我在子对象上得到Null Pointer Exception 。 下面是堆栈跟踪和我的代码。 java.lang.NullPointerException: Attempt to invoke virtual method ‘int android.view.View.getVisibility()’ on a null object reference at com.getbase.floatingactionbutton.FloatingActionsMenu.onMeasure(FloatingActionsMenu.java:224) at android.view.View.measure(View.java:17565) at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1263) at android.widget.FrameLayout.onMeasure(FrameLayout.java:436) at android.widget.ScrollView.onMeasure(ScrollView.java:337) at android.view.View.measure(View.java:17565) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:727) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:463) at android.view.View.measure(View.java:17565) at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:940) at android.view.View.measure(View.java:17565) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5537) at android.widget.FrameLayout.onMeasure(FrameLayout.java:436) at android.view.View.measure(View.java:17565) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:727) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:463) at […]