In Jetpack compose example to load image from drawable folder we will use below code. In the above example we used image composable and create Painter object from painterResource() and pass the resource id. You can read more about Image composable in Jetpack compose
@Composable
fun LoadFromResourceDemo(){
val image: Painter = painterResource(id = R.drawable.image1)
Image(painter = image,contentDescription = "image",)
}
Extract Date and Time from Long Type Variable - RRutors
What is ANR in android?
What is Context?
How to Get bitmap from drawable: Android
Open PDF in Google Drive with Intent in Android - RRutors
FCM Not Receiving Notifications in Android - RRutors
Decompile APK Files: How to Get Source Code - RRutors Guide
Permission denied for window type 2010 in Marshmallow device
Hide/Disable soft keyboard on Activity launch: Android
What is Application?
Invoke-customs are only supported starting with android 0 --min-api 26
How do I check in SQLite whether a table exists?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
Fix Play Store Rejection Due to SMS Permission - RRutors
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
Set Activity to Fullscreen Mode in Android - RRutors
What is Android Fragments?
How to stop EditText focus at Activity startup in Android?
Check List for Generate Signed APK Android
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
How to get a contact image using a phone number in android?
How to copy database from assets folder in android using kotlin
How can i comment inside xml file in android studio?
What happens next when the device switches between portrait and landscape?
How to Use Deprecated Handler() in Android - RRutors Guide
How to find Android Device UDID or unique ID?
How to get complete address from latitude and longitude?
How to validate email address in Android with Kotlin?
How to start a new activity on button click
How to convert DP to Pixel and Pixel to Dp?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
What are Android Versions available?
What is "shared preferences" in Android ?
How to reduce APK package size?
Android Studio project R can't find
What is Intent? What is the difference between an implicit intent and an explicit intent?
What is NetworkOnMainThread Exception?
Add Jar/Library Files as Dependency in Android Studio
Explain Fragment Life Cycle
How to check Android version?