Search code examples
javaandroidbitmapdrawable

Wrong Bitmap in drawable


I try start app in my mobile phone and in emulator on similar type of display.

and If i launch app on another phone for example Google nexus 7 app crashed here

 Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.sstar);

I have only one file drawable. How need put drawable, hdpi, xxhdpi,... ?

I want put more pictures in different size for anyone type of displays.

I don't know where is a problem.

I have only deafult drawable file.

Thanks.

logcat

06-12 12:10:40.919 2528-2528/? I/art: Late-enabling -Xcheck:jni
06-12 12:10:45.767 2528-2565/sk.atest.paradox02.animacia D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
06-12 12:10:45.791 2528-2528/sk.atest.paradox02.animacia D/: HostConnection::get() New Host Connection established 0xb42749a0, tid 2528
06-12 12:10:46.528 2528-2528/sk.atest.paradox02.animacia D/Atlas: Validating map...
06-12 12:10:48.598 2528-2565/sk.atest.paradox02.animacia D/libEGL: loaded /system/lib/egl/libEGL_emulation.so
06-12 12:10:48.599 2528-2565/sk.atest.paradox02.animacia D/libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so
06-12 12:10:48.633 2528-2565/sk.atest.paradox02.animacia D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so
06-12 12:10:48.645 2528-2565/sk.atest.paradox02.animacia D/: HostConnection::get() New Host Connection established 0xb4274c20, tid 2565
06-12 12:10:49.673 2528-2565/sk.atest.paradox02.animacia I/OpenGLRenderer: Initialized EGL, version 1.4
06-12 12:10:50.648 2528-2565/sk.atest.paradox02.animacia D/OpenGLRenderer: Enabling debug mode 0
06-12 12:10:50.669 2528-2565/sk.atest.paradox02.animacia W/EGL_emulation: eglSurfaceAttrib not implemented
06-12 12:10:50.669 2528-2565/sk.atest.paradox02.animacia W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xb4114800, error=EGL_SUCCESS

I thing so it's important. I want put bitmap to canvas.


Solution

  • Right click on your ==>res folder==> new --->Directory--> write directory name like(drawablehdpi,drawableldpi) and put your images their see image

    this