简体   繁体   English

Android 4.0+设备表示无法从位图生成纹理

[英]Android 4.0+ devices says cannot generate texture from bitmap

I have list view with in the adapter i am doing this: 我在适配器中有列表视图,我正在这样做:

Bitmap bitmap = gotBitmap;
        Bitmap bm = Bitmap.createScaledBitmap(bitmap, width, height, true);
        Shader mShader = new BitmapShader(bm, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);

Only in Android devices with 4.0+ it gives me this error "cannot generate texture from bitmap " 仅在具有4.0+的Android设备中,它给我这个错误“无法从位图生成纹理”

In Google Developer Console under optimization tips its given that "Target and minimum Android versions support tablets" 在Google开发者控制台的优化提示下,给出了“目标和最低Android版本支持平板电脑”的信息

So i have added 所以我加了

<uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="18" />

After adding this i am getting this error,if i remove this and run the app, the app works fine. 添加此错误后,我得到此错误,如果我删除此错误并运行该应用程序,则该应用程序可以正常运行。

How to solve this issue? 如何解决这个问题? can anyone please help me. 谁能帮帮我吗。

I have this error because bitmap file is corrupted. 我有此错误,因为位图文件已损坏。 When acceleration is off then imageView is transparent. 禁用加速后,imageView将透明。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM