how to get file name from URI

后端 未结 8 594
花落未央
花落未央 2020-12-16 15:46

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

8条回答
  •  囚心锁ツ
    2020-12-16 16:10

    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();
    

提交回复
热议问题