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);
}
2

2 Answers 2

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)) {
    //...
}
Sign up to request clarification or add additional context in comments.

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.