On 26 Wrz, 14:59, Ashley McConnell <ash...@siroccoracing.com> wrote:
>
> Thanks, That was a workaround I didn't think of, I'll give it a go.  I don't
> understand why the asset URI doesn't work as advertised though.
> --
> Awesome Widgets <http://www.siroccosoftware.com/awesome>
> Online Racing Championship <http://onlineracingchampionship.com>
> Twitter <http://twitter.com/AshMcConnell>

Simply in your ContentProvider
@Override
public AssetFileDescriptor openAssetFile(Uri uri, String mode) throws
FileNotFoundException {
        String path = uri.getPath().substring(1);
        try {
            AssetFileDescriptor afd = mManager.openFd(path);
            return afd;
        } catch (IOException e) {
            throw new FileNotFoundException("No asset found: " + uri);
        }
}

where mManager is initialized in onCreate method as:

mManager = getContext().getAssets();

pskink

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to