Uri uri = Uri.parse("http://www.example.com/search?q=android"); String query = uri.getSchemeSpecificPart(); // returns "www.example.com/search?q=android"
Uri uri = Uri.parse("content://com.example.provider/items/42"); String pathSegment = uri.getSchemeSpecificPart(); // returns "com.example.provider/items/42"
Uri uri = Uri.parse("file:///sdcard/photos/myphoto.jpg"); String fileName = uri.getSchemeSpecificPart(); // returns "/sdcard/photos/myphoto.jpg"Package library: android.net In all of the examples, the package library is android.net as the Uri class is part of the Android framework.