我的運(yùn)行不起來呀
添加了類型轉(zhuǎn)換之后:
listView.setAdapter((ListAdapter)?new?MyAdapter(MainActivity.this,itemBeanList));
跑起來報(bào)錯(cuò):java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zg.myapp9baseadapter/com.example.zg.myapp9baseadapter.MainActivity}: java.lang.ClassCastException: com.example.zg.myapp9baseadapter.MyAdapter cannot be cast to android.widget.ListAdapter
2019-02-22
從報(bào)錯(cuò)信息來看。感覺你的適配器沒有繼承BaseAdapter?
2019-01-18
你得把適配器中的代碼貼出來,不然不好找問題