我收到消息:
在没有当前上下文的情况下调用 OpenGL ES API(每个线程记录一次)
我的应用程序运行良好,但视图寻呼机中没有任何内容。我使用图像加载器下载图像并在其中显示它们。
我想我错误地使用了图像加载器
我的寻呼机适配器类:
public class pageradapter extends PagerAdapter {
Context mContext;
LayoutInflater mLayoutInflater;
List<String> l = MainActivity.list;
ImageLoader mImageLoader;
public pageradapter(Context context) {
mContext = context;
}
@Override
public int getCount() {
return 4;
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
// View itemView = mLayoutInflater.inflate(R.layout.img, container, false);
ImageLoader mImageLoader = ImageLoader.getInstance();
mLayoutInflater=((LayoutInflater) container.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE));
View view = mLayoutInflater.inflate(R.layout.img, container, false);
final ImageView imageView = (ImageView) view.findViewById(R.id.imageView3);
mImageLoader.displayImage(l.get(position),imageView);
container.addView(view);
return view;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((LinearLayout) object);
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view == object;
}
}
我有同样的警告消息,并在互联网上搜索了很多,但没有找到解决方案。我在某处读到有关将 viewpager 的片段的图像视图设置为layout_width并layout_height match_parent并且它有效。不知道怎么做。我使用FragmentPagerAdapter,并通过互联网下载和显示图像。