Android filename with white space cannot be opened

前端 未结 3 627
囚心锁ツ
囚心锁ツ 2021-01-01 06:04

My code works correctly while opening a file in sdcard. However, if I open a filename with white space then error occurs (example: Path - \"/sdcard/download/hello hi.jpg\").

3条回答
  •  渐次进展
    2021-01-01 06:53

    Replace %20 with space like below

    filePath =  filePath.replaceAll("%20"," ");
    

    This worked for me

提交回复
热议问题