android - imageView.setImageBitmap(bitmap) allways null while bitmap not null -


i pass string photo path activity, convert uri (because photo path converted uri), made inputstream uri, , made bitmap inputstream. bitmap created , not null, when call imageview.setimagebitmap(bitmap), system give error that:

void android.widget.imageview.setimageuri(android.net.uri)' on null object reference.

private void showimage(uri mpath) {     photopath=mpath.tostring();     inputstream = null;     try {         = getcontentresolver().openinputstream(mpath);         bitmap bitmap = bitmapfactory.decodestream(is);         is.close();         photo.setimageuri(mpath);     } catch (filenotfoundexception e) {         e.printstacktrace();     } catch (ioexception e) {         e.printstacktrace();     }  } 

what problem met, please me ! thank you

it sounds imageview null. resolving problem fix error.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -