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 start a new activity on button click
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
How do i load image from drawable folder in Jetpack Compose?
What is Intent? What is the difference between an implicit intent and an explicit intent?
How To Set Text Color Programmatically Android TextView?
Android Studio project R can't find
What happens next when the device switches between portrait and landscape?
How to reduce APK package size?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
Permission denied for window type 2010 in Marshmallow device
What is Context?
What is ANR in android?
Invoke-customs are only supported starting with android 0 --min-api 26
Set Activity to Fullscreen Mode in Android - RRutors
How to validate email address in Android with Kotlin?
How to get complete address from latitude and longitude?
How to check Android version?
How to get a contact image using a phone number in android?
How to avoid multiple button click at same time in android?
How do I check in SQLite whether a table exists?
Key Points to remember while develop the Android Application.
FCM Not Receiving Notifications in Android - RRutors
How can i comment inside xml file in android studio?
Check List for Generate Signed APK Android
What is Application?
Fix Android Emulator Kill Error When Running Your App
Fix Play Store Rejection Due to SMS Permission - RRutors
What is the Different Between val and var in Kotlin?
How to Generate signed apk with android studio
How to stop EditText focus at Activity startup in Android?
How to install/ uninstall apk by command line ADB
How to convert milli seconds to hours, minutes and seconds in Android?
What is Android?
Extract Date and Time from Long Type Variable - RRutors
How to find Android Device UDID or unique ID?
What is ANR? How to avoid and resolve it?
How to get screen size (width,height) in Android?
What is "shared preferences" in Android ?
How to save activity State in Android?
How to convert DP to Pixel and Pixel to Dp?