你这Adapter是什么Adapter?? 是不是没有绑定好数据呢 ?
  源码贴贴,然后排排版,看着太乱 .

解决方案 »

  1.   

        我猜,madapter是NULL
      

  2.   

    同意楼上, 建议看一下 madapter 是不是null, 
      

  3.   

    private SpeechListAdapter madapter=null;private class SpeechListAdapter extends BaseAdapter {
    public SpeechListAdapter(Context context) {
    mContext = context;
    } public int getCount() {
    return MAX_DAYNUM;
    } public Object getItem(int position) {
    return position;
    } public long getItemId(int position) {
    return position;
    } public View getView(int position, View convertView, ViewGroup parent) {
    。。
    return convertView;
    } private Context mContext;
    }
      

  4.   

    报nullpointer,说明此时madapter为null
    怎么在broadcast receiver之前,就把madapter给new了呢?
    望知道的朋友提示~~~
      

  5.   

       因为貌似在Receiver的生命周期中,onReceiver函数是第一个被激发的,如果无法在这个函数中把madapter给new了的话,那么可能还有两个办法:
       1. 重载receiver的构造函数,在构造函数里new madapter(貌似很少有人这么干的)
       2. 把一个new好的madapter放进广播的intent里面,然后onreceive函数中要用的时候,把这个madapter取出来用。
       这个是我能想到的办法,能不能行就不知道了,我的android水平连打个酱油都很呛