Code example for AndroidRuntimeException

                FileInputStream stream = new FileInputStream(file);
                // Check we can fit the file in memory. 
                int length = (int) file.length();
                if (file.length() > Integer.MAX_VALUE) {
                    throw new AndroidRuntimeException("Image too large to load.");
                byte[] buffer = new byte[length];
                return buffer;
            } catch (IOException ex) {
                throw new AndroidRuntimeException(ex);
         * Generates a low resolution bitmap (1/4 of the size) that can be used for thumbnails to reduce memory 
         * usage. 
Connect your IDE to all the code out there  Get Codota for Java