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",)
}
Fix Play Store Rejection Due to SMS Permission - RRutors
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
How to convert DP to Pixel and Pixel to Dp?
What happens next when the device switches between portrait and landscape?
How can i comment inside xml file in android studio?
How to check Android version?
Extract Date and Time from Long Type Variable - RRutors
Fix Android Emulator Kill Error When Running Your App
Fix Duplicate Files in APK Build.gradle Issue - RRutors
How to Generate signed apk with android studio
How to stop EditText focus at Activity startup in Android?
What is Context?
How to convert milli seconds to hours, minutes and seconds in Android?
How to validate email address in Android with Kotlin?
How to copy database from assets folder in android using kotlin
Android Studio project R can't find
Set Activity to Fullscreen Mode in Android - RRutors
What is Android Fragments?
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
What is Application?
How to reduce APK package size?
What is "shared preferences" in Android ?
How to get an image resource by it's name in android?
Check List for Generate Signed APK Android
Permission denied for window type 2010 in Marshmallow device
Invoke-customs are only supported starting with android 0 --min-api 26
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
How do I check in SQLite whether a table exists?
How to save activity State in Android?
What is NetworkOnMainThread Exception?
How to find Android Device UDID or unique ID?
How to get complete address from latitude and longitude?
What are Android Versions available?
What is Android?
How to Get bitmap from drawable: Android
Add Jar/Library Files as Dependency in Android Studio
What is the Different Between val and var in Kotlin?
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
FCM Not Receiving Notifications in Android - RRutors
How to start a new activity on button click