我的应用程序共享图像但同时用户在后台关闭应用程序。日志为空,没有错误,没有警告。你能看到错误吗?
try {
fout = new FileOutputStream(imageFile);
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, fout);
fout.flush();
fout.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Uri uri = Uri.fromFile(new File(mPath));
btn1.setVisibility(View.VISIBLE);
btn2.setVisibility(View.VISIBLE);
watermark.setVisibility(View.INVISIBLE);
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("image/jpeg");
shareIntent.putExtra(android.content.Intent.EXTRA_STREAM, uri);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
startActivity(shareIntent);
} else {
startActivity(Intent.createChooser(shareIntent, "Compartir Vía"));
}
编辑: