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?
Explain Fragment Life Cycle
How to start a new activity on button click
What is the difference between match_parent and fill_parent?
FCM Not Receiving Notifications in Android - RRutors
How to copy database from assets folder in android using kotlin
How to stop EditText focus at Activity startup in Android?
Open PDF in Google Drive with Intent in Android - RRutors
How to convert DP to Pixel and Pixel to Dp?
How to get a contact image using a phone number in android?
How to convert milli seconds to hours, minutes and seconds in Android?
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
Set Activity to Fullscreen Mode in Android - RRutors
What is NetworkOnMainThread Exception?
ERR_ACCESS_DENIED in Android Webview with sdk 30
How to save activity State in Android?
How to Get bitmap from drawable: Android
Hide/Disable soft keyboard on Activity launch: Android
How do I generate random numbers in Dart?
How to get complete address from latitude and longitude?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
How to get an image resource by it's name in android?
How to reduce APK package size?
Symmetric vs Asymmetric Encryption in Android Server - RRutors
What is Context?
Fix Play Store Rejection Due to SMS Permission - RRutors
What are Android Versions available?
What is "shared preferences" in Android ?
How to get screen size (width,height) in Android?
Key Points to remember while develop the Android Application.
Add Jar/Library Files as Dependency in Android Studio
What is Android?
How to install/ uninstall apk by command line ADB
How to Use Deprecated Handler() in Android - RRutors Guide
Check List for Generate Signed APK Android
What is Android Fragments?
Invoke-customs are only supported starting with android 0 --min-api 26
Fix Android Emulator Kill Error When Running Your App
How to check Android version?
What is Application?