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());
ERR_ACCESS_DENIED in Android Webview with sdk 30
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
How to start a new activity on button click
What is Application?
How to Generate signed apk with android studio
How to Exit android app on back pressed?
Fix Android Emulator Kill Error When Running Your App
How to check Android version?
Explain Fragment Life Cycle
What is the difference between match_parent and fill_parent?
Set Activity to Fullscreen Mode in Android - RRutors
Key Points to remember while develop the Android Application.
How do I generate random numbers in Dart?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
How To Set Text Color Programmatically Android TextView?
How to avoid multiple button click at same time in android?
How do i load image from drawable folder in Jetpack Compose?
How to copy database from assets folder in android using kotlin
How can i comment inside xml file in android studio?
What is the Different Between val and var in Kotlin?
What is Android Fragments?
How to stop EditText focus at Activity startup in Android?
What happens next when the device switches between portrait and landscape?
Hide/Disable soft keyboard on Activity launch: Android
What is ANR in android?
What are Android Versions available?
How do I check in SQLite whether a table exists?
Extract Date and Time from Long Type Variable - RRutors
What is NetworkOnMainThread Exception?
Permission denied for window type 2010 in Marshmallow device
How to install/ uninstall apk by command line ADB
What is Intent? What is the difference between an implicit intent and an explicit intent?
FCM Not Receiving Notifications in Android - RRutors
What are the notifications available in android?
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
How to validate email address in Android with Kotlin?
What is Android?
How to get a contact image using a phone number in android?
How to Use Deprecated Handler() in Android - RRutors Guide