Loading Bitmaps Effectively
This Topic Mainly Concentrate on Loading the Bitmaps Effectively in Android Devices.
When it comes to loading a bitmap, the question comes where it is loaded from.
Here we are going to discuss about how to load the Bitmap from Resource with in the Android Device. i.e. eg from Gallery.
We will go through this by example which are discussed below.
<uses-permission> -- > Tag Used for the Permission .
android:name -- > An attribute used to give name for the permission we are going to request.
android.permission.READ_EXTERNAL_STORAGE --> It is System permissions
- example "android.permission.CAMERA" or "android.permission.READ_CONTACTS"
Load the Image from Resource from Android Device. Using Intents.
Using Intents to Load the Image from Gallery.
- Initially you need to have the permission
- Use the Following Code to have the layout as designed follows.
- Use the Following code to Display the image with button Click.
Button Click will be
- Once you clicked on the button , it will open the gallery with help of intent.
You need to select image and send it back to main activity. Here with help of onActivityResult we can do that.
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0