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());
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
How to convert milli seconds to hours, minutes and seconds in Android?
Extract Date and Time from Long Type Variable - RRutors
What is ANR? How to avoid and resolve it?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
How to convert DP to Pixel and Pixel to Dp?
What is "shared preferences" in Android ?
How to save activity State in Android?
How to Get bitmap from drawable: Android
What is Android Fragments?
Add Jar/Library Files as Dependency in Android Studio
What is Android?
Check List for Generate Signed APK Android
What is NetworkOnMainThread Exception?
How do I generate random numbers in Dart?
How to copy database from assets folder in android using kotlin
Decompile APK Files: How to Get Source Code - RRutors Guide
How to Use Deprecated Handler() in Android - RRutors Guide
How to stop EditText focus at Activity startup in Android?
Invoke-customs are only supported starting with android 0 --min-api 26
Hide/Disable soft keyboard on Activity launch: Android
FCM Not Receiving Notifications in Android - RRutors
How to get an image resource by it's name in android?
How to install/ uninstall apk by command line ADB
How to get complete address from latitude and longitude?
Permission denied for window type 2010 in Marshmallow device
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
How to get a contact image using a phone number in android?
What is Application?
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
How to avoid multiple button click at same time in android?
How to Exit android app on back pressed?
ERR_ACCESS_DENIED in Android Webview with sdk 30
What is ANR in android?
Explain Fragment Life Cycle
How to get screen size (width,height) in Android?
What happens next when the device switches between portrait and landscape?
Key Points to remember while develop the Android Application.
What is Context?
How can i comment inside xml file in android studio?