Referring Resources in an Application through URI

Normally we refer resources in an application using resource ID. There is an alternative way to refer resources in Android. That is through Uri. This will be useful when we want to load an image in webview using loadUrl() for zooming.

The format is,

android.resource://[package-name]/res-id


eg: Uri.parse("android.resource://com.smartandroidians.sample/"+R.raw.zoom_image);

Popular posts from this blog

AlarmManager and Notification in Android

Swipe Action and ViewFlipper in Android

Open Gallery and get the selected image in appplication