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());
What are the notifications available in android?
Add Jar/Library Files as Dependency in Android Studio
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
How can i comment inside xml file in android studio?
What are Android Versions available?
What happens next when the device switches between portrait and landscape?
Decompile APK Files: How to Get Source Code - RRutors Guide
What is "shared preferences" in Android ?
How to find Android Device UDID or unique ID?
How to Exit android app on back pressed?
How to Use Deprecated Handler() in Android - RRutors Guide
What is Intent? What is the difference between an implicit intent and an explicit intent?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
How to get an image resource by it's name in android?
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
How to start a new activity on button click
How to Get bitmap from drawable: Android
What is Android?
What is NetworkOnMainThread Exception?
How To Set Text Color Programmatically Android TextView?
What is ANR in android?
ERR_ACCESS_DENIED in Android Webview with sdk 30
How to convert DP to Pixel and Pixel to Dp?
What is Context?
Symmetric vs Asymmetric Encryption in Android Server - RRutors
What is the difference between match_parent and fill_parent?
How to stop EditText focus at Activity startup in Android?
How to copy database from assets folder in android using kotlin
How to get complete address from latitude and longitude?
How do I check in SQLite whether a table exists?
Fix Android Emulator Kill Error When Running Your App
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
How to get a contact image using a phone number in android?
Open PDF in Google Drive with Intent in Android - RRutors
Check List for Generate Signed APK Android
How to avoid multiple button click at same time in android?
Fix Play Store Rejection Due to SMS Permission - RRutors
How to reduce APK package size?
Android Studio project R can't find
How do I generate random numbers in Dart?