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());
FCM Not Receiving Notifications in Android - RRutors
What is Android Fragments?
What is Context?
Add Jar/Library Files as Dependency in Android Studio
How to check Android version?
What is "shared preferences" in Android ?
Invoke-customs are only supported starting with android 0 --min-api 26
Decompile APK Files: How to Get Source Code - RRutors Guide
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to get complete address from latitude and longitude?
What is ANR? How to avoid and resolve it?
Set Activity to Fullscreen Mode in Android - RRutors
Extract Date and Time from Long Type Variable - RRutors
Key Points to remember while develop the Android Application.
How do I check in SQLite whether a table exists?
Symmetric vs Asymmetric Encryption in Android Server - RRutors
What are the notifications available in android?
How to stop EditText focus at Activity startup in Android?
How to copy database from assets folder in android using kotlin
Hide/Disable soft keyboard on Activity launch: Android
How to get an image resource by it's name in android?
How to Exit android app on back pressed?
Permission denied for window type 2010 in Marshmallow device
How do i load image from drawable folder in Jetpack Compose?
Open PDF in Google Drive with Intent in Android - RRutors
What is Android?
What is ANR in android?
How To Set Text Color Programmatically Android TextView?
How to find Android Device UDID or unique ID?
How to convert milli seconds to hours, minutes and seconds in Android?
Android Studio project R can't find
What is NetworkOnMainThread Exception?
What is the Different Between val and var in Kotlin?
Explain Fragment Life Cycle
What is the difference between match_parent and fill_parent?
How to validate email address in Android with Kotlin?
What happens next when the device switches between portrait and landscape?
How to get screen size (width,height) in Android?
How to save activity State in Android?
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors