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 happens next when the device switches between portrait and landscape?
What is Application?
How to start a new activity on button click
What is Android Fragments?
How To Set Text Color Programmatically Android TextView?
Fix Play Store Rejection Due to SMS Permission - RRutors
Check List for Generate Signed APK Android
How to check Android version?
How to find Android Device UDID or unique ID?
Decompile APK Files: How to Get Source Code - RRutors Guide
How do I check in SQLite whether a table exists?
How to get an image resource by it's name in android?
Add Jar/Library Files as Dependency in Android Studio
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
What are the notifications available in android?
FCM Not Receiving Notifications in Android - RRutors
How to save activity State in Android?
How do I generate random numbers in Dart?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
Explain Fragment Life Cycle
How to Exit android app on back pressed?
Open PDF in Google Drive with Intent in Android - RRutors
How to Use Deprecated Handler() in Android - RRutors Guide
What are Android Versions available?
What is the Different Between val and var in Kotlin?
Fix Android Emulator Kill Error When Running Your App
Invoke-customs are only supported starting with android 0 --min-api 26
What is Intent? What is the difference between an implicit intent and an explicit intent?
What is Context?
How to validate email address in Android with Kotlin?
How to install/ uninstall apk by command line ADB
How to get screen size (width,height) in Android?
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
What is the difference between match_parent and fill_parent?
How to avoid multiple button click at same time in android?
Extract Date and Time from Long Type Variable - RRutors
How to get a contact image using a phone number in android?
How to get complete address from latitude and longitude?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
ERR_ACCESS_DENIED in Android Webview with sdk 30