Although it is not possible to directly refer to the package name, to use 'resource' in xml or in code:
package.R.resource_type.resource_name
and
@[package:]resource_type/resource_name
NOTE. The package here does not mean 'java package' , but package == application , so if you are accessing a resource that is defined in your own application, you can skip it. That is why we use @strings/name or directly R.strings.name . Similar to using the resources defined by android, we will use @android:string/name or android.R.string.name
Sahil majajan mj
source share