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 Behavior Subclass BottomSheetBehavior Exception - RRutors
How to copy database from assets folder in android using kotlin
Symmetric vs Asymmetric Encryption in Android Server - RRutors
What is ANR in android?
Explain Fragment Life Cycle
How to Generate signed apk with android studio
How to Use Deprecated Handler() in Android - RRutors Guide
How to get screen size (width,height) in Android?
Check List for Generate Signed APK Android
How to save activity State in Android?
How to Get bitmap from drawable: Android
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
What is Intent? What is the difference between an implicit intent and an explicit intent?
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
How To Set Text Color Programmatically Android TextView?
How to reduce APK package size?
Open PDF in Google Drive with Intent in Android - RRutors
How do i load image from drawable folder in Jetpack Compose?
What is Android Fragments?
What is the difference between match_parent and fill_parent?
How to check Android version?
How do I generate random numbers in Dart?
Key Points to remember while develop the Android Application.
How to install/ uninstall apk by command line ADB
Permission denied for window type 2010 in Marshmallow device
How to avoid multiple button click at same time in android?
How to validate email address in Android with Kotlin?
What are the notifications available in android?
What is "shared preferences" in Android ?
ERR_ACCESS_DENIED in Android Webview with sdk 30
What is Context?
How to get a contact image using a phone number in android?
How to convert DP to Pixel and Pixel to Dp?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
Extract Date and Time from Long Type Variable - RRutors
Hide/Disable soft keyboard on Activity launch: Android
Fix Android Emulator Kill Error When Running Your App
What is NetworkOnMainThread Exception?
How to start a new activity on button click