0

画像を置き換えるソリューションを探しています。メディア。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);

感謝

4

1 に答える 1

0

これを試すことができます:

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