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());
How to avoid multiple button click at same time in android?
How To Set Text Color Programmatically Android TextView?
How to start a new activity on button click
How to convert DP to Pixel and Pixel to Dp?
Key Points to remember while develop the Android Application.
What are the notifications available in android?
How to Use Deprecated Handler() in Android - RRutors Guide
What happens next when the device switches between portrait and landscape?
What is the Different Between val and var in Kotlin?
How to get an image resource by it's name in android?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
Add Jar/Library Files as Dependency in Android Studio
How to check Android version?
How to convert milli seconds to hours, minutes and seconds in Android?
How to find Android Device UDID or unique ID?
What are Android Versions available?
What is the difference between match_parent and fill_parent?
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
Explain Fragment Life Cycle
How to validate email address in Android with Kotlin?
How to save activity State in Android?
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to Exit android app on back pressed?
Android Studio project R can't find
How to reduce APK package size?
What is Context?
Fix Play Store Rejection Due to SMS Permission - RRutors
What is Android?
How to get a contact image using a phone number in android?
Extract Date and Time from Long Type Variable - RRutors
Decompile APK Files: How to Get Source Code - RRutors Guide
ERR_ACCESS_DENIED in Android Webview with sdk 30
How to install/ uninstall apk by command line ADB
How to Get bitmap from drawable: Android
Set Activity to Fullscreen Mode in Android - RRutors
How to copy database from assets folder in android using kotlin
What is Application?
How do I check in SQLite whether a table exists?
Open PDF in Google Drive with Intent in Android - RRutors
How do i load image from drawable folder in Jetpack Compose?