不访问适配器 getView() 方法



这是我的适配器:

public GamblingVideoAdapter(Context context, ArrayList<GamblingVideosBean> gamblingVideosBeans) {
this.context = context;
this.gamblingVideosBeans = gamblingVideosBeans;
Log.d("===GamblingVideoAdapter", "adaper text : " + gamblingVideosBeans.size());
}
@Override
public int getCount() {
return gamblingVideosBeans.size();
}
@Override
public Object getItem(int position) {
return gamblingVideosBeans.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Log.d("===gambling", "adapter hi kevin");
return null;
}  

这是我在日志中得到的:

10-05 19:09:20.118 5925-5925/com.sb.android.acg.test I/Ads: Scheduling ad refresh 60000 milliseconds from now.
10-05 19:09:20.386 5925-7768/com.sb.android.acg.test D/===GamblingVideoAdapter: adaper text : 50  

我尝试了Stackoverflow中给出的所有答案,但似乎没有一个能解决我的问题。

试试这个

runOnUiThread(new Runnable() {
@Override
public void run() {
gamblingVideoAdapter = new GamblingVideoAdapter(GamblingVideosActivity.this, videosBeans);
lvGamblingVideos.setAdapter(gamblingVideoAdapter);
}
});  

最新更新