concept gallery in category android

This is an excerpt from Manning's book 50 Android Hacks.
Sometimes as developers we need to achieve weird layouts based on a designer’s wireframes. Some months ago, I was involved with a project where the wireframes had an image gallery on top and a list of items on the bottom. It sounds simple—I placed an Android Gallery and a ListView below it—but when the designer saw the application running he came to me and said, “I’d like to be able to scroll down to the point where the gallery disappears.”
In this hack, I’ll show how I created what the designer wanted: a gallery of images and a list of numbers where you can scroll down until the gallery disappears. The finished application can be seen in figure 28.1.
If you use the mobile messenger app, WhatsApp, you might know that you can share images with your contacts from an image in the gallery or by taking a photo. The dialog presented to the user to pick an image from the gallery or to take a picture is shown in figure 35.1. Obviously, this was created with intents but, unfortunately, it can’t be done with only one.
To pick an image from the gallery, we do this: