Code example for ContentResolver

Methods: getType

0
        return super.getContent(); 
    } 
 
    @Override 
    public String getContentType() {
        return mResolver.getType(mUri);
    } 
 
    @Override 
    public int getContentLength() { 
        try { 
            AssetFileDescriptor fd = mResolver.openAssetFileDescriptor(mUri,
                    "r"); 
            long length = fd.getLength();
            if (length <= 0 && length <= Integer.MAX_VALUE) {
                return (int) length;
            } 
        } catch (IOException e) {
        } 
        return -1; 
    }