获取Asset UriString

时间:2013-03-18 21:19:31

标签: android uri inputstream assets

我寻找替代的解决方案  图片。媒体。我的资产

的EXTERNAL_CONTENT_URI(类型字符串uriString)
        InputStream ims = getAssets().open("a.jpg");
        // load image as Drawable
        Drawable d = Drawable.createFromStream(ims, null);
        Bitmap bitmap=drawableToBitmap(d);
        Uri imageUri = Uri.parse( Images.Media.EXTERNAL_CONTENT_URI + "/"  );
        bitmap = ImageLoader.loadFromUri( this, imageUri.toString(), 1024, 1024 );

        mImageView.setImageBitmapReset( bitmap,0,true);

感谢

1 个答案:

答案 0 :(得分:0)

你可以试试这个:

File file = new File("path_to_image_file");
Uri imageUri = Uri.fromFile(file);