当我尝试从设置应用程序中打开“声音”时,它会因以下异常而崩溃:
11-11 19:47:40.080: E/AndroidRuntime(6305): FATAL EXCEPTION: Thread-773
11-11 19:47:40.080: E/AndroidRuntime(6305): java.lang.IllegalStateException: Unknown URL: content://media/internal/audio/media/30/30
11-11 19:47:40.080: E/AndroidRuntime(6305): at android.os.Parcel.readException(Parcel.java:1433)
11-11 19:47:40.080: E/AndroidRuntime(6305): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:188)
11-11 19:47:40.080: E/AndroidRuntime(6305): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
11-11 19:47:40.080: E/AndroidRuntime(6305): at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)
11-11 19:47:40.080: E/AndroidRuntime(6305): at android.content.ContentResolver.query(ContentResolver.java:370)
11-11 19:47:40.080: E/AndroidRuntime(6305): at android.content.ContentResolver.query(ContentResolver.java:313)
11-11 19:47:40.080: E/AndroidRuntime(6305): at com.android.settings.SoundSettings.updateRingtoneName(SoundSettings.java:331)
11-11 19:47:40.080: E/AndroidRuntime(6305): at com.android.settings.SoundSettings.access$300(SoundSettings.java:52)
11-11 19:47:40.080: E/AndroidRuntime(6305): at com.android.settings.SoundSettings$3.run(SoundSettings.java:252)
11-11 19:47:40.080: E/AndroidRuntime(6305): at java.lang.Thread.run(Thread.java:856)
好像这个 URI 不存在:
内容://媒体/内部/音频/媒体/30/30
我跑了一个
Uri.parse("content://media/internal/audio/media/30/30").getPath()
我回来了
/内部/音频/媒体/30/30
但是 /internal 在我的设备的文件系统上不存在。
我的问题是,如何创建 URI 引用的这个文件,以便应用程序不会因为丢失而崩溃?
谢谢