本帖最后由 nupt_is 于 2012-05-17 17:27:39 编辑

解决方案 »

  1.   

     空指针异常 MyExpandableListAdapter 这个 167 行 !自己瞧瞧  
      

  2.   


    谢谢哥们儿哈找到问题了全局变量定义了
    private Context mContext = null;(就是这儿)
    private boolean[] isOpen = null;
    private LayoutInflater mInflater = null;
    private ContactManager contactManager;
    private GroupManager groupManager;
    private int contactId;
    private List<Integer> contactCountByGroup;
    private List<String> groupItem = new ArrayList<String>();
    private List<List<Contact>> contacts = new ArrayList<List<Contact>>();
    然后够着方法里赋值时有一组值忘记赋了 public MyExpandableListAdapter(List<Integer> contactCountByGroup,
    List<String> groupItem, List<List<Contact>> contacts,
    boolean[] isOpen, Context context) { this.contactCountByGroup = contactCountByGroup;
    this.groupItem = groupItem;
    this.contacts = contacts;
    this.isOpen = isOpen;
    this.mInflater = LayoutInflater.from(context);
    this.mContext=context;(就是这里)
    this.contactManager = new ContactManager(context);
    this.groupManager = new GroupManager(context); }
    所以下面用到时空指针异常。。
      

  3.   

    谢谢哥们儿哈找到问题了全局变量定义了
     private Context mContext = null;(就是这儿)
     private boolean[] isOpen = null;
     private LayoutInflater mInflater = null;
     private ContactManager contactManager;
     private GroupManager groupManager;
     private int contactId;
     private List<Integer> contactCountByGroup;
     private List<String> groupItem = new ArrayList<String>();
     private List<List<Contact>> contacts = new ArrayList<List<Contact>>();
    然后够着方法里赋值时有一组值忘记赋了 public MyExpandableListAdapter(List<Integer> contactCountByGroup,
     List<String> groupItem, List<List<Contact>> contacts,
     boolean[] isOpen, Context context) { this.contactCountByGroup = contactCountByGroup;
     this.groupItem = groupItem;
     this.contacts = contacts;
     this.isOpen = isOpen;
     this.mInflater = LayoutInflater.from(context);
     this.mContext=context;(就是这里)
    this.contactManager = new ContactManager(context);
     this.groupManager = new GroupManager(context); }
    所以下面用到时空指针异常。。