想把gridview中的某一个宫格设为disenable,我用的是SimpleAdapter,在oncreate()中 gridview.getAtChild(0).setEnable(false) 出现 crash,那位有办法

解决方案 »

  1.   

    报的错误:The application TestGridView (process test.TestGridView) has stopped unexceptedly.Please try again.
      

  2.   

    写个方法放到 onCreate()外面 。
      

  3.   

    NullpointException,此时gridView中,并没有从adapter中拿到数据。所以gridview.getAtChild(0)取得的是空值。建议解决方案使用BaseAdapter,override其中的
        public boolean isEnabled(int position){}
    方法来实现这一功能。