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 Android?
What is the difference between match_parent and fill_parent?
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
Hide/Disable soft keyboard on Activity launch: Android
Permission denied for window type 2010 in Marshmallow device
How to find Android Device UDID or unique ID?
Fix Duplicate Files in APK Build.gradle Issue - RRutors
How to check Android version?
How to convert milli seconds to hours, minutes and seconds in Android?
Check List for Generate Signed APK Android
Explain Fragment Life Cycle
Key Points to remember while develop the Android Application.
Fix Play Store Rejection Due to SMS Permission - RRutors
Symmetric vs Asymmetric Encryption in Android Server - RRutors
What is NetworkOnMainThread Exception?
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to reduce APK package size?
How to stop EditText focus at Activity startup in Android?
How do I check in SQLite whether a table exists?
How to copy database from assets folder in android using kotlin
What is "shared preferences" in Android ?
FCM Not Receiving Notifications in Android - RRutors
How do I generate random numbers in Dart?
Fix Android Emulator Kill Error When Running Your App
Emulator: emulator: ERROR: Can't find 'Linux version ' string in kernel image file: Andr
How to Exit android app on back pressed?
What happens next when the device switches between portrait and landscape?
How to save activity State in Android?
What is the Different Between val and var in Kotlin?
What is Application?
How to get a contact image using a phone number in android?
How to avoid multiple button click at same time in android?
How to start a new activity on button click
ERR_ACCESS_DENIED in Android Webview with sdk 30
Add Jar/Library Files as Dependency in Android Studio
How to Get bitmap from drawable: Android
How to Use Deprecated Handler() in Android - RRutors Guide
How to get complete address from latitude and longitude?
What are Android Versions available?
How to install/ uninstall apk by command line ADB