is MediaStore Audio Uri - Android Media

Android examples for Media:Audio

Description

is MediaStore Audio Uri

Demo Code


//package com.java2s;

import android.net.Uri;

import android.provider.MediaStore.Audio;

public class Main {
    public static boolean isAudioUri(Uri uri) {
        if (uri == null) {
            return false;
        }//from w ww.  j av a 2s  . co  m
        String uriStr = uri.toString();
        return uriStr.startsWith(Audio.Media.EXTERNAL_CONTENT_URI
                .toString())
                || uriStr.startsWith(Audio.Media.INTERNAL_CONTENT_URI
                        .toString());
    }
}

Related Tutorials