rounding - round profile image in android -


this question has answer here:

i use below code making round profile picture in android

http://www.androidhub4you.com/2014/10/android-custom-shape-imageview-rounded.html

but in main activity used listfragment instead of activity

imageviewround = imageview)parentview.findviewbyid(r.id.imageview_round); bitmap icon = bitmapfactory.decoderesource(getresources(),r.drawable.noimage_square); imageviewround.setimagebitmap(icon); 

i'm getting error

05-15 12:21:27.359: e/androidruntime(25107): caused by: java.lang.nullpointerexception: attempt invoke virtual method 'void android.widget.imageview.setimagebitmap(android.graphics.bitmap)' on null object reference 

try these

 com.androidhub4you.crop.roundedimageview imageviewround =(com.androidhub4you.crop.roundedimageview) parentview.findviewbyid(r.id.imageview_round); 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -