提示错误:

 1 java.lang.NullPointerException
 2 Exception details are logged in Window > Show View > Error Log
 3 
 4 java.lang.NullPointerException
 5     at com.xxxx.ui.xxxxview.IphoneTreeView.onLayout(IphoneTreeView.java:236)
 6     at android.view.View.layout(View.java:14817)
 7     at android.view.ViewGroup.layout(ViewGroup.java:4631)
 8     at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
 9     at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
10     at android.view.View.layout(View.java:14817)
11     at android.view.ViewGroup.layout(ViewGroup.java:4631)
12 ....

意思是提示 指针或对象空,具体列表;

解决方法:点击“IphoneTreeView.java:236”会跳到错误的.JAVA代码中,

对对象或指针进行判断不为NULL再使用。如:

1         int state =0; 
2         if (mAdapter != null)//加上判断就可以解决,之前是没有判断引起的
3           state = mAdapter.getTreeHeaderState(groupPos, childPos);

 

相关文章:

  • 2021-09-18
  • 2021-12-10
  • 2022-12-23
  • 2021-10-30
  • 2021-05-11
  • 2021-10-21
  • 2021-04-10
  • 2022-02-22
猜你喜欢
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2021-10-17
  • 2021-07-24
  • 2022-01-25
相关资源
相似解决方案