Finally after searching a lot i found the solution.
If you want to get any resource URI then there are two ways :
-
Using Resource Name
Syntax :
android.resource://[package]/[res type]/[res name]
Example :
Uri.parse("android.resource://com.my.package/drawable/icon");
-
Using Resource Id
Syntax :
android.resource://[package]/[resource_id]
Example :
Uri.parse("android.resource://com.my.package/" + R.drawable.icon);
This were the examples to get the URI of any image file stored in drawable folder.
Similarly you can get URIs of res/raw folder.
In my case i used 1st way ie. Using Resource Name