【发布时间】:2016-12-15 18:13:43
【问题描述】:
我从 Json 获取图像并将其显示在网格视图中。在选择图像时,图像会放大到全屏并提供共享选项。当我单击共享选项时,在 API 22 以上的手机上,加载栏不会消失。它在棒棒糖之前都很好用。不知道为什么它在 Marshmallow 中不起作用。
这里是代码
public void share(View view){
// Get access to the URI for the bitmap
pDialog = new ProgressDialog(Displaydemo.this);
pDialog.setMessage("Loading...");
pDialog.show();
niv1 = (NetworkImageView) findViewById(R.id.imgNetwork);
Uri bmpUri = getLocalBitmapUri(niv1);
if (bmpUri != null) {
pDialog.dismiss();
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, bmpUri);
shareIntent.putExtra(Intent.EXTRA_SUBJECT,"share");
shareIntent.putExtra(Intent.EXTRA_TEXT,Datas.Address );
shareIntent.setType("image/*");
startActivity(Intent.createChooser(shareIntent, "Share Image"));
}
}
【问题讨论】:
标签: android