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 Play Store Rejection Due to SMS Permission - RRutors
What is the difference between match_parent and fill_parent?
Decompile APK Files: How to Get Source Code - RRutors Guide
Key Points to remember while develop the Android Application.
How can i comment inside xml file in android studio?
How do I generate random numbers in Dart?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
How to reduce APK package size?
What is the Different Between val and var in Kotlin?
What is Application?
What are the notifications available in android?
What is Android Fragments?
What is ANR in android?
What is Android?
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
What is NetworkOnMainThread Exception?
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to convert milli seconds to hours, minutes and seconds in Android?
How to convert DP to Pixel and Pixel to Dp?
How do I check in SQLite whether a table exists?
How to validate email address in Android with Kotlin?
What is "shared preferences" in Android ?
How to copy database from assets folder in android using kotlin
What happens next when the device switches between portrait and landscape?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
Fix Android Emulator Kill Error When Running Your App
How to find Android Device UDID or unique ID?
How to get a contact image using a phone number in android?
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
Hide/Disable soft keyboard on Activity launch: Android
Permission denied for window type 2010 in Marshmallow device
How to get screen size (width,height) in Android?
Add Jar/Library Files as Dependency in Android Studio
How to check Android version?
Open PDF in Google Drive with Intent in Android - RRutors
What is ANR? How to avoid and resolve it?
How to get an image resource by it's name in android?
Extract Date and Time from Long Type Variable - RRutors
How to Generate signed apk with android studio
How to install/ uninstall apk by command line ADB