With Resources.getIdentifier() method we can get the resource id by its name. If we know drawable name then we can get drawable id by If we know color name then we can get color id by
int resId = getResources().getIdentifier("Name of Resource", "drawable", mApplicationContext.getPackageName());
int resId = getResources().getIdentifier("Name of Resource", "color", mApplicationContext.getPackageName());
Set Activity to Fullscreen Mode in Android - RRutors
What is ANR in android?
How to check Android version?
Add Jar/Library Files as Dependency in Android Studio
How to validate email address in Android with Kotlin?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
How to convert DP to Pixel and Pixel to Dp?
Hide/Disable soft keyboard on Activity launch: Android
How to convert milli seconds to hours, minutes and seconds in Android?
Explain Fragment Life Cycle
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to get a contact image using a phone number in android?
What is the Different Between val and var in Kotlin?
Decompile APK Files: How to Get Source Code - RRutors Guide
How to Generate signed apk with android studio
How to save activity State in Android?
Extract Date and Time from Long Type Variable - RRutors
How to copy database from assets folder in android using kotlin
What happens next when the device switches between portrait and landscape?
How to find Android Device UDID or unique ID?
How to install/ uninstall apk by command line ADB
What is "shared preferences" in Android ?
How to reduce APK package size?
What is Application?
What are Android Versions available?
How to Get bitmap from drawable: Android
How do i load image from drawable folder in Jetpack Compose?
Fix Play Store Rejection Due to SMS Permission - RRutors
Open PDF in Google Drive with Intent in Android - RRutors
FCM Not Receiving Notifications in Android - RRutors
Invoke-customs are only supported starting with android 0 --min-api 26
How to get screen size (width,height) in Android?
Android Studio project R can't find
How to start a new activity on button click
How can i comment inside xml file in android studio?
What is Android?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
What are the notifications available in android?
Permission denied for window type 2010 in Marshmallow device
What is NetworkOnMainThread Exception?