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());
Decompile APK Files: How to Get Source Code - RRutors Guide
Key Points to remember while develop the Android Application.
How to get a contact image using a phone number in android?
How can i comment inside xml file in android studio?
Android Studio project R can't find
Set Activity to Fullscreen Mode in Android - RRutors
How to get screen size (width,height) in Android?
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to convert DP to Pixel and Pixel to Dp?
How to copy database from assets folder in android using kotlin
Check List for Generate Signed APK Android
How To Set Text Color Programmatically Android TextView?
Hide/Disable soft keyboard on Activity launch: Android
How to start a new activity on button click
How to install/ uninstall apk by command line ADB
How to Get bitmap from drawable: Android
What are Android Versions available?
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
How to Use Deprecated Handler() in Android - RRutors Guide
What is "shared preferences" in Android ?
What is the Different Between val and var in Kotlin?
Fix Android Emulator Kill Error When Running Your App
How to convert milli seconds to hours, minutes and seconds in Android?
How to avoid multiple button click at same time in android?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
How to find Android Device UDID or unique ID?
How to Exit android app on back pressed?
How to reduce APK package size?
What happens next when the device switches between portrait and landscape?
FCM Not Receiving Notifications in Android - RRutors
Open PDF in Google Drive with Intent in Android - RRutors
Invoke-customs are only supported starting with android 0 --min-api 26
How to stop EditText focus at Activity startup in Android?
ERR_ACCESS_DENIED in Android Webview with sdk 30
Symmetric vs Asymmetric Encryption in Android Server - RRutors
How do I check in SQLite whether a table exists?
How do i load image from drawable folder in Jetpack Compose?
What is the difference between match_parent and fill_parent?
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
What is ANR? How to avoid and resolve it?