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());
Open PDF in Google Drive with Intent in Android - RRutors
What is Android?
FCM Not Receiving Notifications in Android - RRutors
How to convert milli seconds to hours, minutes and seconds in Android?
Fix Android Emulator Kill Error When Running Your App
How to Generate signed apk with android studio
How can i comment inside xml file in android studio?
Invoke-customs are only supported starting with android 0 --min-api 26
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 validate email address in Android with Kotlin?
How to Get bitmap from drawable: Android
How to get screen size (width,height) in Android?
What is Application?
Key Points to remember while develop the Android Application.
Check List for Generate Signed APK Android
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
Set Activity to Fullscreen Mode in Android - RRutors
How do I check in SQLite whether a table exists?
What is Intent? What is the difference between an implicit intent and an explicit intent?
How do I generate random numbers in Dart?
How to copy database from assets folder in android using kotlin
How to start a new activity on button click
How to install/ uninstall apk by command line ADB
Explain Fragment Life Cycle
Decompile APK Files: How to Get Source Code - RRutors Guide
Hide/Disable soft keyboard on Activity launch: Android
What is Context?
What is ANR in android?
How to Exit android app on back pressed?
ERR_ACCESS_DENIED in Android Webview with sdk 30
How to reduce APK package size?
Permission denied for window type 2010 in Marshmallow device
Symmetric vs Asymmetric Encryption in Android Server - RRutors
What is NetworkOnMainThread Exception?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
Fix Play Store Rejection Due to SMS Permission - RRutors
How To Set Text Color Programmatically Android TextView?
How to get complete address from latitude and longitude?
How to find Android Device UDID or unique ID?