0

Project is working well on emulator x86 api 6.0. but not on device htc m 6.0
here is code

if (img_uri != null && img_uri.equalsIgnoreCase("image")) {
    bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.gghh);
    img_input_d.setImageBitmap(bitmap);
}
Sathish Kumar J
  • 4,280
  • 1
  • 20
  • 48
Sukhmanpreet
  • 35
  • 1
  • 9

2 Answers2

1

You should not have a nullpointer exception since you make a null check. But anyways, you can do it like following just to be on the safe side:

if ("image".equalsIgnoreCase(img_uri)) {
    //...
}
yrazlik
  • 10,411
  • 33
  • 99
  • 165
0

Finally i am answering my que I am surfing with it
so i found that some device want full specification of condition

here is my code

if (img_uri!=null&&!img_uri.isEmpty()&&!img_uri.equals("null")&&img_uri.equals("image") {}

it works for me

Sukhmanpreet
  • 35
  • 1
  • 9