Code example for AndroidRuntimeException

    public int load(AssetFileDescriptor afd, int priority) {
        if (afd != null) {
            long len = afd.getLength();
            if (len < 0) {
                throw new AndroidRuntimeException("no length for fd");
            return _load(afd.getFileDescriptor(), afd.getStartOffset(), len, priority);
        } else { 
            return 0; 
     * Load the sound from a FileDescriptor. 
     * This version is useful if you store multiple sounds in a single 
     * binary. The offset specifies the offset from the start of the file 
     * and the length specifies the length of the sound within the file. 
Stop searching for code, let great code find you!  Add Codota to your java IDE