android - Video Intent not saving video to desired location -


i have implemented code save captured video custom location.

// constants final static int request_video_captured = 1; string capture_title="myvideo.3gp"; // specified desired location here file file = new file(environment.getexternalstoragedirectory() + "/dcim", capture_title); uri outputfileuri = uri.fromfile( file ); intent intent = new intent(android.provider.mediastore.action_video_capture); intent.putextra(android.provider.mediastore.extra_output, outputfileuri); startactivityforresult(intent, request_video_captured); 

now on activity result m getting default path , not desired path intent save video.

@override protected void onactivityresult(int requestcode, int resultcode, intent data) { if (resultcode == result_ok) { uri capturedimageuri = data.getdata(); toast.maketext(this, capturedimageuri .getpath(), toast.length_long).show(); } } 

now dont know why not saving desired location similar thing did try image capture , worked.

also have added desired permissions.

any thoughts!!

try instead...

file file = new file(environment.getexternalstoragepublicdirectory(environment.directory_dcim)), capture_title); 

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -