I fetch images from Json and display it in a gridview. On select an image, image enlarges to fullscreen and share option is available. As I click on share option, on phones above API 22, loading bar is not dismissing. It works well till Lollipop. Dont know why its not working in Marshmallow.
Here is the code
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"));
}
}