Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get file name from URI

Hello I am develop video player with android gallery. I receive URI from gallry. and I need to display video title, when play video. so if content has not title meta data. I need to disaplay video file name. How to get video content file name?

thank you

like image 332
byungkyu Avatar asked Nov 24 '10 02:11

byungkyu


1 Answers

Here is the code for getting name of file from url

Uri u = Uri.parse("www.google.com/images/image.jpg");

File f = new File("" + u);

f.getName();
like image 111
fargath Avatar answered Oct 05 '22 06:10

fargath