how to open bitmap in gallery in android -


hi want open image in gallery, below code

mimageview.setimagebitmap(apputil.getbitmapfromfile(obj.getimageurl(), 200, 200));      mimageview.setonclicklistener(new onclicklistener() {         @override         public void onclick(view view) {             intent intent = new intent();             intent.setaction(intent.action_view);             intent.setdataandtype(uri.parse(obj.getimageurl()), "image/*");             startactivity(intent);         }     }); 

but showing nullpointerexception

uri.parse(obj.getimageurl() returns below string 

/mnt/sdcard/pictures/app_images/pro20130429_170323_-1793725321.tmp

update: tried
startactivity(new intent(intent.action_view, uri.parse("file://sdcard/pictures/app_images/pro20130429_170323_-1793725321.tmp"))); , getting error

05-03 16:40:18.460: e/androidruntime(4764): android.content.activitynotfoundexception: no activity found handle intent { act=android.intent.action.view dat=file://sdcard/pictures/app_images/pro20130429_170323_-1793725321.tmp } 

try 1

intent intent = new intent(); intent.setaction(intent.action_view); intent.setdataandtype(uri.parse("file://" + "/sdcard/pictures/app_images/pro20130429_170323_-1793725321.tmp"), "image/*"); startactivity(intent); 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -