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",)
}
What is Application?
How do I check in SQLite whether a table exists?
How to get complete address from latitude and longitude?
How to Exit android app on back pressed?
How do i load image from drawable folder in Jetpack Compose?
What is "shared preferences" in Android ?
How to convert DP to Pixel and Pixel to Dp?
What is NetworkOnMainThread Exception?
Open PDF in Google Drive with Intent in Android - RRutors
Invoke-customs are only supported starting with android 0 --min-api 26
ERR_ACCESS_DENIED in Android Webview with sdk 30
Symmetric vs Asymmetric Encryption in Android Server - RRutors
How to convert milli seconds to hours, minutes and seconds in Android?
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
How to validate email address in Android with Kotlin?
How to start a new activity on button click
How to find Android Device UDID or unique ID?
How to copy database from assets folder in android using kotlin
Hide/Disable soft keyboard on Activity launch: Android
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to check Android version?
How to avoid multiple button click at same time in android?
What is the Different Between val and var in Kotlin?
What is ANR? How to avoid and resolve it?
Explain Fragment Life Cycle
How to Use Deprecated Handler() in Android - RRutors Guide
Extract Date and Time from Long Type Variable - RRutors
Set Activity to Fullscreen Mode in Android - RRutors
What happens next when the device switches between portrait and landscape?
How to save activity State in Android?
What is Context?
How to get screen size (width,height) in Android?
Decompile APK Files: How to Get Source Code - RRutors Guide
Check List for Generate Signed APK Android
What is the difference between match_parent and fill_parent?
How To Set Text Color Programmatically Android TextView?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
Add Jar/Library Files as Dependency in Android Studio