The Android system provides the sharing function (text and images can be shared at the same time ),
Zookeeper
/*** Sharing Function ** @ param context * @ param activityTitle * Activity name * @ param msgTitle * Message Title * @ param msgText * message content * @ param imgPath * image path, if you do not share an image, pass null */public void shareMsg (String activityTitle, String msgTitle, String msgText, String imgPath) {Intent intent = new Intent (Intent. ACTION_SEND); if (imgPath = null | imgPath. equals ("") {intent. setType ("text/plain"); // plain text} else {File f = New File (imgPath); if (f! = Null & f. exists () & f. isFile () {intent. setType ("image/jpg"); Uri u = Uri. fromFile (f); intent. putExtra (Intent. EXTRA_STREAM, u) ;}} intent. putExtra (Intent. EXTRA_SUBJECT, msgTitle); intent. putExtra (Intent. EXTRA_TEXT, msgText); intent. setFlags (Intent. FLAG_ACTIVITY_NEW_TASK); startActivity (Intent. createChooser (intent, activityTitle ));}
Simple and Easy to use!