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
Post a Comment