【问题标题】:How to get Bitmap image from OI file manager path?如何从 OI 文件管理器路径获取位图图像?
【发布时间】:2012-06-05 22:21:03
【问题描述】:

我的应用程序需要从图库中选择一张图片。

我开始活动:

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), PICK_IMAGE);

它会提示从图库或 OI 文件管理器中选择

对于 OI 文件管理器,我从 Uri 获取路径如下:

Uri selectedImageUri = data.getData();
filemanagerstring = selectedImageUri.getPath();

现在如何从文件管理器字符串中获取位图图像?

【问题讨论】:

    标签: android


    【解决方案1】:

    你可以用这个:

    BitmapFactory.decodeFile(String pathName);

    here

    【讨论】:

    • 尽管这很旧。 BitmapFactory 据我所知不使用大括号,正确的语法是 BitmapFactory.decode... +1
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多