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

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -