0

I look for a solution to replace Images. Media. EXTERNAL_CONTENT_URI (type String uriString) by my asset

        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);

thank

4

1 回答 1

0

你可以试试这个:

File file = new File("path_to_image_file");
Uri imageUri = Uri.fromFile(file);
于 2013-03-18T21:43:39.233 回答