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 Exit android app on back pressed?
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
Decompile APK Files: How to Get Source Code - RRutors Guide
How to validate email address in Android with Kotlin?
What is Android?
Extract Date and Time from Long Type Variable - RRutors
How to get an image resource by it's name in android?
How can i comment inside xml file in android studio?
What happens next when the device switches between portrait and landscape?
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to Generate signed apk with android studio
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
What is ANR? How to avoid and resolve it?
How to install/ uninstall apk by command line ADB
What are the notifications available in android?
Symmetric vs Asymmetric Encryption in Android Server - RRutors
What is NetworkOnMainThread Exception?
What is the Different Between val and var in Kotlin?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
How do i load image from drawable folder in Jetpack Compose?
How to get complete address from latitude and longitude?
How to convert milli seconds to hours, minutes and seconds in Android?
Fix Android Emulator Kill Error When Running Your App
How to stop EditText focus at Activity startup in Android?
Android Studio project R can't find
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
What is Application?
Key Points to remember while develop the Android Application.
How to find Android Device UDID or unique ID?
How to avoid multiple button click at same time in android?
Fix Play Store Rejection Due to SMS Permission - RRutors
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
Check List for Generate Signed APK Android
Set Activity to Fullscreen Mode in Android - RRutors
How do I check in SQLite whether a table exists?
How to reduce APK package size?
How to copy database from assets folder in android using kotlin
What are Android Versions available?
How to get screen size (width,height) in Android?
Add Jar/Library Files as Dependency in Android Studio