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 do I check in SQLite whether a table exists?
What are Android Versions available?
What is NetworkOnMainThread Exception?
How to find Android Device UDID or unique ID?
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
How to stop EditText focus at Activity startup in Android?
Extract Date and Time from Long Type Variable - RRutors
Open PDF in Google Drive with Intent in Android - RRutors
How to Use Deprecated Handler() in Android - RRutors Guide
Set Activity to Fullscreen Mode in Android - RRutors
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
How to Get bitmap from drawable: Android
Decompile APK Files: How to Get Source Code - RRutors Guide
How to get an image resource by it's name in android?
How to avoid multiple button click at same time in android?
How to Generate signed apk with android studio
Explain Fragment Life Cycle
ERR_ACCESS_DENIED in Android Webview with sdk 30
What is ANR? How to avoid and resolve it?
What is the Different Between val and var in Kotlin?
How to get screen size (width,height) in Android?
What happens next when the device switches between portrait and landscape?
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
How to reduce APK package size?
How do I generate random numbers in Dart?
Check List for Generate Signed APK Android
How to get complete address from latitude and longitude?
How do i load image from drawable folder in Jetpack Compose?
How to Exit android app on back pressed?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
What is Android?
Invoke-customs are only supported starting with android 0 --min-api 26
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to get a contact image using a phone number in android?
What is Context?
How to install/ uninstall apk by command line ADB
What is "shared preferences" in Android ?
How to copy database from assets folder in android using kotlin
Hide/Disable soft keyboard on Activity launch: Android
What is Android Fragments?