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 stop EditText focus at Activity startup in Android?
What is Application?
How to get an image resource by it's name in android?
Android Studio project R can't find
How to install/ uninstall apk by command line ADB
What are Android Versions available?
How to reduce APK package size?
What are the notifications available in android?
How to get screen size (width,height) in Android?
What is NetworkOnMainThread Exception?
FCM Not Receiving Notifications in Android - RRutors
Fix Android Emulator Kill Error When Running Your App
What is Intent? What is the difference between an implicit intent and an explicit intent?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
What is the Different Between val and var in Kotlin?
How to Use Deprecated Handler() in Android - RRutors Guide
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
Hide/Disable soft keyboard on Activity launch: Android
Fix Play Store Rejection Due to SMS Permission - RRutors
How to avoid multiple button click at same time in android?
Symmetric vs Asymmetric Encryption in Android Server - RRutors
What is Android?
Explain Fragment Life Cycle
How to Exit android app on back pressed?
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
What is ANR in android?
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
How to check Android version?
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
What is ANR? How to avoid and resolve it?
Extract Date and Time from Long Type Variable - RRutors
What is Android Fragments?
What is Context?
How to copy database from assets folder in android using kotlin
How do I generate random numbers in Dart?
Add Jar/Library Files as Dependency in Android Studio
Invoke-customs are only supported starting with android 0 --min-api 26
Check List for Generate Signed APK Android
Key Points to remember while develop the Android Application.
How to Generate signed apk with android studio