我能够使用来自URI方法getUnlockedImageUri的ImageManager显示成就图像,但由于某些原因,我需要找到图像的本地路径,因为我不想使用ImageView和I需要将图像的实际文件路径查找本地路径getUnlockedImageUri
谷歌的URI玩游戏的成绩看起来是这样的content://com.google.android.gms.games.background/images/d2bbfba4/61
,我是希望能够将其转换为一个File
对象象下面这样:
File myFile = new File(ach.getUnlockedImageUri().getPath());
Log.i(ExConsts.TAG, "myFile.exists() = " + myFile.exists());
// returns false!
但是,不起作用!任何想法为什么?或者我应该尝试什么?或者甚至告诉我是否有可能?