简体   繁体   English

在Android中使用imageloader时“在没有当前上下文的情况下调用OpenGL ES API”

[英]“call to OpenGL ES API with no current context” while using imageloader in android

i am getting message: 我收到消息:

call to OpenGL ES API with no current context (logged once per thread) 在没有当前上下文的情况下调用OpenGL ES API(每个线程记录一次)

and my app runs fine but nothing appears in view pager .I have used imageloader to download images and display them in it. 而且我的应用程序运行正常,但视图分页器中没有任何显示。我已使用imageloader下载图像并将其显示在其中。

i think i have used imageloader incorrectly 我想我没有正确使用imageloader

my pageradapter class: 我的pageradapter类别:

 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;
    }
}

I had the same warning message and searched a lot over internet but found no solution. 我有同样的警告消息,并在Internet上进行了大量搜索,但没有找到解决方案。 Somewhere I read about setting viewpager's fragment's imageview layout_width and layout_height to match_parent and it works. 我在某处读到有关将viewpager片段的imageview layout_width和layout_height设置为match_parent的方法,并且可以正常工作。 Don't know how. 不知道怎么做 I used FragmentPagerAdapter and was downloading and displaying images over internet. 我使用FragmentPagerAdapter并通过Internet下载和显示图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在没有当前上下文的情况下调用OpenGL ES API - Call to OpenGL ES API with no current context ARToolkit-在没有当前上下文的情况下调用OpenGL ES API - ARToolkit - call to OpenGL ES API with no current context Android NDK OpenGL glDeleteTextures导致错误:在没有当前上下文的情况下调用OpenGL ES API - Android NDK OpenGL glDeleteTextures causes error: call to OpenGL ES API with no current context 没有当前上下文的opengl es api - opengl es api with no current context E / libEGL:调用OpenGL ES API,没有当前上下文(每个线程记录一次) - Android / SDL - E/libEGL: call to OpenGL ES API with no current context (logged once per thread) - Android/SDL 为什么我“在没有当前上下文的情况下调用OpenGL ES API”? - Why am I getting “call to OpenGL ES API with no current context”? 错误/libEGL(206):在没有当前上下文的情况下调用 OpenGL ES API - ERROR/libEGL(206): call to OpenGL ES API with no current context 调用没有当前上下文的OpenGL ES API(每个线程记录一次) - call to OpenGL ES API with no current context (logged once per thread) 在没有当前上下文的情况下调用OpenGL ES API(每个线程记录一次)-OpenGL ES - call to OpenGL ES API with no current context (logged once per thread) - OpenGL ES 处理和“没有当前上下文的OpenGL ES API” - Processing and “OpenGL ES API with no current context”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM