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",)
}
ERROR Android emulator gets killed when I try to run my application and choose an emulator it ret
INSTALL_FAILED_INVALID_APK: Split lib_slice_9_apk was defined multiple times. It is possible that th
How to Generate signed apk with android studio
How to copy database from assets folder in android using kotlin
FragmentPagerAdapter deprecated, Since API 27.1.0 FragmentPagerAdapter is deprecated.
What is Android Fragments?
What is Application?
Explain Fragment Life Cycle
ERR_ACCESS_DENIED in Android Webview with sdk 30
Google play store rejected my app due to SMS permission I removed SMS permission from the manifes
How to Get bitmap from drawable: Android
Duplicate files during packaging of APK” build.gradle issue: Android Studio
Could not inflate Behavior subclass android.support.design.widget. BottomSheetBehavior How resolve
How to get complete address from latitude and longitude?
Permission denied for window type 2010 in Marshmallow device
'constructor Handler()' is deprecated. Deprecated in Java, How to use Handler() class in And
What is Android?
How do I generate random numbers in Dart?
How to find Android Device UDID or unique ID?
Key Points to remember while develop the Android Application.
Error: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path
How to validate email address in Android with Kotlin?
How to Exit android app on back pressed?
Intent for Drive PDF Viewer - How to open PDF in Google Drive with intent
What is ANR in android?
What are the notifications available in android?
How to stop EditText focus at Activity startup in Android?
How to convert milli seconds to hours, minutes and seconds in Android?
Android Activity FullScreen - How to set activity to fullscreen mode in Android?
What are Android Versions available?
Check List for Generate Signed APK Android
Android Studio project R can't find
How do i load image from drawable folder in Jetpack Compose?
What is NetworkOnMainThread Exception?
How to save activity State in Android?
How to get a contact image using a phone number in android?
How to reduce APK package size?
What are symmetric and asymmetric encryption in the way Android interacts with the server?
What is Intent? What is the difference between an implicit intent and an explicit intent?
How to convert DP to Pixel and Pixel to Dp?