android - Take Picture on camera but no find thumbnail -
i picture camera no official stamp following code in pictures take.
code :-
intent intent = new intent("android.media.action.image_capture"); photo = this.createtemporaryfile("photo", ".jpg"); photo.delete(); cekilenresimuri = uri.fromfile(photo); intent.putextra(mediastore.extra_output, cekilenresimuri); startactivityforresult(intent, kameradan_resim_al);
onactivity result:-
this.getcontentresolver().notifychange(cekilenresimuri, null); contentresolver cr = this.getcontentresolver(); bitmapfactory.options options = new bitmapfactory.options(); cekilenresim = bitmapfactory.decodefile(cekilenresimuri.getpath(), options); editorresim.setimagebitmap(cekilenresim);
how can overcome problem?
if able captured image bitmap. can’t find thumbnail have add image in gallery. can add these lines:
private void galleryaddpic() { intent mediascanintent = new intent(intent.action_media_scanner_scan_file); file f = new file(mcurrentphotopath); uri contenturi = uri.fromfile(f); mediascanintent.setdata(contenturi); this.sendbroadcast(mediascanintent); }
Comments
Post a Comment