Home > Mobile >  The Android native share other types of files such as drawing (DWG), secondary share to WeChat be ad
The Android native share other types of files such as drawing (DWG), secondary share to WeChat be ad

Time:10-15

Android native file sharing. (DWG) file format of drawing, secondary share the WeChat added. DWG.. Bin suffix, this problem bothering me for a long time, could you tell me what the reason and solution, so thank you,
Try {
if (! File. The exists ()) return;//return
check failed to open the fileIntent 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. Get string (R.s tring. Share)));//"share"
} the catch (Exception e) {
e.printStackTrace();
}
}
  • Related