android - BitmapFactory.decodeResource return null in Emulator API level 5 -


I have this code

  @OrrideCreative on Public Zero (Bundle Saved InstantState ) {Super. OnCreate (savedInstanceState); SetContentView (R.layout.main); MImageView = (ImageView) findViewById (R.id.image); Bitmap MBITMAP = BitmapFranet Decresource (getResources (), ordrawable.con); MImageView.setImageBitmap (mBitmap); }   

This Android emulator works fine in level 6 but the amilator does not work in level 5, which was not dependent on the library level in my project. In emulator level 5, the bitmap factory decodeResource return null.

How to fix it

Try,

place a drawable folder inside the res folder and place your icon.png image.

  res / drawable / icon.png   

And then you can try the code above.

Comments

Popular posts from this blog

php - Creating canonical URLs with custom route-classes -

mysql - Formatting problem with PHP DateTime Difference when used as part of an equation -

Mysql Local server hardware -