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());
How to get screen size (width,height) in Android?
Permission denied for window type 2010 in Marshmallow device
What is Application?
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
How to add jar/library files as a dependency in Android studio gradle file
How to Generate signed apk with android studio
How to find Android Device UDID or unique ID?
'constructor Handler()' is deprecated. Deprecated in Java, How to use Handler() class in And
Is There A Way To Get The Source Code From An APK File? (or) How to decompile apk?
What is NetworkOnMainThread Exception?
What are Android Versions available?
How do I check in SQLite whether a table exists?
What is Android Fragments?
How to convert milli seconds to hours, minutes and seconds in Android?
What is the difference between match_parent and fill_parent?
Error: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path
How to get a contact image using a phone number in android?
How to save activity State in Android?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
How to avoid multiple button click at same time in android?
Check List for Generate Signed APK Android
How to check Android version?
What is ANR? How to avoid and resolve it?
Android Studio project R can't find
How to Exit android app on back pressed?
What are symmetric and asymmetric encryption in the way Android interacts with the server?
Explain Fragment Life Cycle
How do I generate random numbers in Dart?
How to validate email address in Android with Kotlin?
ERR_ACCESS_DENIED in Android Webview with sdk 30
How to stop EditText focus at Activity startup in Android?
Android FCM not receiving notifications when app is removed from background
How to install/ uninstall apk by command line ADB
How to convert DP to Pixel and Pixel to Dp?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
How do i load image from drawable folder in Jetpack Compose?
How can i comment inside xml file in android studio?
Invoke-customs are only supported starting with android 0 --min-api 26
How to extract date and time from Long type variable in Kotlin on Android "
What are the notifications available in android?