毕加索没有从三星galaxy设备加载图像

问题描述 投票:0回答:1

在Nexus和LG G3设备上(我到目前为止已尝试过)我正在将设备内存中的图像成功加载到ImageView(使用Picasso),如下所示:

mProfileImageView.setOnClickListener(new View.OnClickListener() 
{
    @Override
    public void onClick(View v) {
        Intent intent = new Intent();
        intent.setType("image/*");
        intent.setAction(Intent.ACTION_GET_CONTENT);
        startActivityForResult(Intent.createChooser(intent, "Select Picture"), 2);
    }
});


@Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == getActivity().RESULT_OK) {
        Picasso.with(getContext()).setLoggingEnabled(true);
        if (requestCode == 2) {
            Picasso.with(getContext())
                    .load(data.getData())
                    .noPlaceholder()
                    .centerCrop()
                    .fit()
                    .into(mProfileImageView);
        }
    }
}

但是,从某些奇怪的原因来看,这对Galaxy S4和S5无效。

我正在使用Picasso 2.5.2

任何善良的灵魂能帮助我吗?

提前致谢!

android imageview picasso
1个回答
0
投票

我终于想通了!

三星设备使用外部存储器是一个许可问题。将以下行添加到清单后:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

有效!

© www.soinside.com 2019 - 2024. All rights reserved.