The example on the above URL uses decodeResources, because the image is not part of the app we have to use decodeFile. However decodeFile requires an absolute file path as a parameter. This URL http://stackoverflow.com/questions/8885204/how-to-get-the-file-path-from-uri , describes how to get an absolute path from a URI as below:
File myFile = new File(uri.getPath());
myFile.getAbsolutePath();
PROBLEM
Setting more than one image causes the app to crash. This is because the images are too large.
POSSIBLE SOLUTION
Using BitmapFactory you can re-size the image to stop it from causing a memory outage check out this link http://developer.android.com/training/displaying-bitmaps/load-bitmap.html for more information.
FURTHER INVESTIGATION
The example on the above URL uses decodeResources, because the image is not part of the app we have to use decodeFile. However decodeFile requires an absolute file path as a parameter. This URL http://stackoverflow.com/questions/8885204/how-to-get-the-file-path-from-uri , describes how to get an absolute path from a URI as below:
File myFile = new File(uri.getPath()); myFile.getAbsolutePath();
Then we use:
decodeFile (String pathName, BitmapFactory.Options opts)