解决方案 »

  1.   

    context可以在构造器中传入,如:
        public MyAdapter(Context context, int resource, List<Item> itemList) {
            super(context, resource, itemList);        this.context = context;
            this.inflater = LayoutInflater.from(context);
            this.resource = resource;
        }
      

  2.   

    楼上已经解决,在创建MyBaseAdapter类的时候,写个构造器传入context,
    private Context context;
    public MyBaseAdapter(Context context){
      this.context = context;
    }