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",)
}
How to copy database from assets folder in android using kotlin
Set Activity to Fullscreen Mode in Android - RRutors
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
Symmetric vs Asymmetric Encryption in Android Server - RRutors
How to stop EditText focus at Activity startup in Android?
What is ANR in android?
What are Android Versions available?
What is Android?
How to Exit android app on back pressed?
How to convert milli seconds to hours, minutes and seconds in Android?
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
What is ANR? How to avoid and resolve it?
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to check Android version?
Permission denied for window type 2010 in Marshmallow device
How to Get bitmap from drawable: Android
How do i load image from drawable folder in Jetpack Compose?
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
Hide/Disable soft keyboard on Activity launch: Android
How to get a contact image using a phone number in android?
What happens next when the device switches between portrait and landscape?
Add Jar/Library Files as Dependency in Android Studio
What are the notifications available in android?
Decompile APK Files: How to Get Source Code - RRutors Guide
Fix Duplicate Files in APK Build.gradle Issue - RRutors
How to get screen size (width,height) in Android?
How do I check in SQLite whether a table exists?
What is Application?
What is NetworkOnMainThread Exception?
Invoke-customs are only supported starting with android 0 --min-api 26
How to find Android Device UDID or unique ID?
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 start a new activity on button click
How to save activity State in Android?
How To Set Text Color Programmatically Android TextView?
FCM Not Receiving Notifications in Android - RRutors
How to avoid multiple button click at same time in android?
How to reduce APK package size?
What is Context?