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());
Extract Date and Time from Long Type Variable - RRutors
How to find Android Device UDID or unique ID?
How to get an image resource by it's name in android?
What happens next when the device switches between portrait and landscape?
Decompile APK Files: How to Get Source Code - RRutors Guide
How to get complete address from latitude and longitude?
How to Generate signed apk with android studio
What is "shared preferences" in Android ?
How to copy database from assets folder in android using kotlin
What is Application?
What is the Different Between val and var in Kotlin?
How to convert DP to Pixel and Pixel to Dp?
FCM Not Receiving Notifications in Android - RRutors
What is ANR? How to avoid and resolve it?
Hide/Disable soft keyboard on Activity launch: Android
What is Intent? What is the difference between an implicit intent and an explicit intent?
How do I check in SQLite whether a table exists?
What is Android?
Set Activity to Fullscreen Mode in Android - RRutors
What is ANR in android?
How do I generate random numbers in Dart?
How to stop EditText focus at Activity startup in Android?
What is the difference between match_parent and fill_parent?
What are the notifications available in android?
How to install/ uninstall apk by command line ADB
What is Context?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
How to convert milli seconds to hours, minutes and seconds in Android?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
Fix Android Emulator Kill Error When Running Your App
Key Points to remember while develop the Android Application.
Permission denied for window type 2010 in Marshmallow device
How to Use Deprecated Handler() in Android - RRutors Guide
How to save activity State in Android?
Invoke-customs are only supported starting with android 0 --min-api 26
How to validate email address in Android with Kotlin?
How to reduce APK package size?
Add Jar/Library Files as Dependency in Android Studio