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 Android Emulator Kill Error When Running Your App
What is Android?
How to install/ uninstall apk by command line ADB
How to save activity State in Android?
Add Jar/Library Files as Dependency in Android Studio
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
Symmetric vs Asymmetric Encryption in Android Server - RRutors
How to Get bitmap from drawable: Android
How to Exit android app on back pressed?
How to convert DP to Pixel and Pixel to Dp?
How to Generate signed apk with android studio
How to check Android version?
What are the notifications available in android?
How to get an image resource by it's name in android?
Permission denied for window type 2010 in Marshmallow device
What is ANR? How to avoid and resolve it?
Key Points to remember while develop the Android Application.
How to validate email address in Android with Kotlin?
How to get complete address from latitude and longitude?
What are Android Versions available?
Set Activity to Fullscreen Mode in Android - RRutors
What is ANR in android?
Check List for Generate Signed APK Android
Android Studio project R can't find
What is Android Fragments?
How to copy database from assets folder in android using kotlin
How to Use Deprecated Handler() in Android - RRutors Guide
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
Open PDF in Google Drive with Intent in Android - RRutors
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
What happens next when the device switches between portrait and landscape?
ERR_ACCESS_DENIED in Android Webview with sdk 30
FCM Not Receiving Notifications in Android - RRutors
How To Set Text Color Programmatically Android TextView?
How to reduce APK package size?
Fix Play Store Rejection Due to SMS Permission - RRutors
What is the difference between match_parent and fill_parent?
Extract Date and Time from Long Type Variable - RRutors
How to get a contact image using a phone number in android?