Uri uri = Uri.parse("content://com.example.hello.HelloFileProvider/my_musics/0x0000600001/extend.json"); Log.i(TAG, uri.getAuthority()); Log.i(TAG, uri.getEncodedAuthority()); Log.i(TAG, uri.getPath()); Log.i(TAG, uri.getEncodedPath()); Log.i(TAG, uri.getLastPathSegment()); Log.i(TAG, uri.getSchemeSpecificPart()); uri.getPathSegments().forEach(seg-> Log.i(TAG + "111", seg));
2022-10-20 11:45:06.659 29021-29021/com.example.HelloWorld2 I/MainActivity---szl---: com.example.hello.HelloFileProvider 2022-10-20 11:45:06.659 29021-29021/com.example.HelloWorld2 I/MainActivity---szl---: com.example.hello.HelloFileProvider 2022-10-20 11:45:06.659 29021-29021/com.example.HelloWorld2 I/MainActivity---szl---: /my_musics/0x0000600001/extend.json 2022-10-20 11:45:06.659 29021-29021/com.example.HelloWorld2 I/MainActivity---szl---: /my_musics/0x0000600001/extend.json 2022-10-20 11:45:06.660 29021-29021/com.example.HelloWorld2 I/MainActivity---szl---: extend.json 2022-10-20 11:45:06.660 29021-29021/com.example.HelloWorld2 I/MainActivity---szl---: //com.example.hello.HelloFileProvider/my_musics/0x0000600001/extend.json 2022-10-20 11:45:06.660 29021-29021/com.example.HelloWorld2 I/MainActivity---szl---111: my_musics 2022-10-20 11:45:06.661 29021-29021/com.example.HelloWorld2 I/MainActivity---szl---111: 0x0000600001 2022-10-20 11:45:06.661 29021-29021/com.example.HelloWorld2 I/MainActivity---szl---111: extend.json
标签:29021,20,szl,Uri,---,android,解析,com,example From: https://www.cnblogs.com/SaraMoring/p/16809329.html