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 do I check in SQLite whether a table exists?
What is Context?
How to get screen size (width,height) in Android?
What is Android Fragments?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
How do I generate random numbers in Dart?
Symmetric vs Asymmetric Encryption in Android Server - RRutors
How to copy database from assets folder in android using kotlin
How to convert milli seconds to hours, minutes and seconds in Android?
How to get a contact image using a phone number in android?
Android Studio project R can't find
How to Generate signed apk with android studio
How to install/ uninstall apk by command line ADB
Open PDF in Google Drive with Intent in Android - RRutors
What is ANR in android?
Permission denied for window type 2010 in Marshmallow device
Decompile APK Files: How to Get Source Code - RRutors Guide
What are Android Versions available?
FCM Not Receiving Notifications in Android - RRutors
What happens next when the device switches between portrait and landscape?
How to start a new activity on button click
How do i load image from drawable folder in Jetpack Compose?
Add Jar/Library Files as Dependency in Android Studio
How to validate email address in Android with Kotlin?
How to Use Deprecated Handler() in Android - RRutors Guide
How to save activity State in Android?
How to reduce APK package size?
How to get an image resource by it's name in android?
What is ANR? How to avoid and resolve it?
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
What is the difference between match_parent and fill_parent?
Set Activity to Fullscreen Mode in Android - RRutors
How To Set Text Color Programmatically Android TextView?
ERR_ACCESS_DENIED in Android Webview with sdk 30
How to find Android Device UDID or unique ID?
What is Application?
How to stop EditText focus at Activity startup in Android?
How can i comment inside xml file in android studio?
How to avoid multiple button click at same time in android?
What is "shared preferences" in Android ?