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 to get complete address from latitude and longitude?
How to get an image resource by it's name in android?
How to stop EditText focus at Activity startup in Android?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
How to avoid multiple button click at same time in android?
What is "shared preferences" in Android ?
How to convert DP to Pixel and Pixel to Dp?
What happens next when the device switches between portrait and landscape?
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
Fix Duplicate Files in APK Build.gradle Issue - RRutors
How to validate email address in Android with Kotlin?
What is Application?
Permission denied for window type 2010 in Marshmallow device
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to check Android version?
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
Android Studio project R can't find
Explain Fragment Life Cycle
Check List for Generate Signed APK Android
Invoke-customs are only supported starting with android 0 --min-api 26
How to get screen size (width,height) in Android?
How to reduce APK package size?
What is ANR in android?
How to start a new activity on button click
How can i comment inside xml file in android studio?
FCM Not Receiving Notifications in Android - RRutors
How to find Android Device UDID or unique ID?
How to get a contact image using a phone number in android?
What is Android Fragments?
How to Generate signed apk with android studio
How to save activity State in Android?
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
What are Android Versions available?
How to convert milli seconds to hours, minutes and seconds in Android?
What is Context?
How to Use Deprecated Handler() in Android - RRutors Guide
Add Jar/Library Files as Dependency in Android Studio
How to install/ uninstall apk by command line ADB
How to Get bitmap from drawable: Android
Fix Android Emulator Kill Error When Running Your App