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 Use Deprecated Handler() in Android - RRutors Guide
How do I generate random numbers in Dart?
What is Android Fragments?
How do i load image from drawable folder in Jetpack Compose?
Fix Behavior Subclass BottomSheetBehavior Exception - RRutors
Open PDF in Google Drive with Intent in Android - RRutors
How to convert DP to Pixel and Pixel to Dp?
Android Studio project R can't find
How to Generate signed apk with android studio
Explain Fragment Life Cycle
Check List for Generate Signed APK Android
Invoke-customs are only supported starting with android 0 --min-api 26
Fix Error: Use JsonReader.setLenient(true) for Malformed JSON
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to install/ uninstall apk by command line ADB
Permission denied for window type 2010 in Marshmallow device
What is "shared preferences" in Android ?
How to convert milli seconds to hours, minutes and seconds in Android?
What happens next when the device switches between portrait and landscape?
What is ANR in android?
How do I check in SQLite whether a table exists?
Fix Android Emulator Kill Error When Running Your App
ERR_ACCESS_DENIED in Android Webview with sdk 30
What is Application?
How to get a contact image using a phone number in android?
What are Android Versions available?
Hide/Disable soft keyboard on Activity launch: Android
What is NetworkOnMainThread Exception?
Decompile APK Files: How to Get Source Code - RRutors Guide
How To Set Text Color Programmatically Android TextView?
Symmetric vs Asymmetric Encryption in Android Server - RRutors
How to save activity State in Android?
Add Jar/Library Files as Dependency in Android Studio
How to start a new activity on button click
How to Exit android app on back pressed?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
What is Context?
What is Android?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
How to get an image resource by it's name in android?