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 Duplicate Files in APK Build.gradle Issue - RRutors
What happens next when the device switches between portrait and landscape?
Set Activity to Fullscreen Mode in Android - RRutors
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
How can i comment inside xml file in android studio?
What are the notifications available in android?
How to check Android version?
How do i load image from drawable folder in Jetpack Compose?
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
How to convert milli seconds to hours, minutes and seconds in Android?
How to Generate signed apk with android studio
Symmetric vs Asymmetric Encryption in Android Server - RRutors
How to convert DP to Pixel and Pixel to Dp?
How to save activity State in Android?
What is Intent? What is the difference between an implicit intent and an explicit intent?
What is Context?
Key Points to remember while develop the Android Application.
How to install/ uninstall apk by command line ADB
What is "shared preferences" in Android ?
Fix Play Store Rejection Due to SMS Permission - RRutors
How to validate email address in Android with Kotlin?
How to avoid multiple button click at same time in android?
Android Studio project R can't find
What is the difference between match_parent and fill_parent?
ERR_ACCESS_DENIED in Android Webview with sdk 30
What is Android Fragments?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
FCM Not Receiving Notifications in Android - RRutors
What is the Different Between val and var in Kotlin?
Fix Android Emulator Kill Error When Running Your App
How To Set Text Color Programmatically Android TextView?
How to get an image resource by it's name in android?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
How to copy database from assets folder in android using kotlin
How to Exit android app on back pressed?
Invoke-customs are only supported starting with android 0 --min-api 26
What is Android?
How do I generate random numbers in Dart?
How to start a new activity on button click
Check List for Generate Signed APK Android