Android原生分享檔案(.dwg)格式的圖紙檔案,二次分享到微信會加.dwg..bin的后綴名,這個問題困擾我很久了,請問什么原因和解決方法,萬分謝謝。
try {
if (!file.exists()) return;// 檢查打開檔案失敗時回傳
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("application/octet-stream");
// intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
intent.putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(activity, "fileprovider", file));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
activity.startActivity(Intent.createChooser(intent, activity.getString(R.string.share)));// "分享"
} catch (Exception e) {
e.printStackTrace();
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/172675.html
標籤:Android
上一篇:華為 華三 思科常用命令
