String contentdetails = "friends come and play *** game handle"; intent = new intent (intent. action_send); // enable the intent attribute for sharing and sending. settype ("text/plain"); intent. settype ("image/*"); // list of Image Sharing information types <resolveinfo> resinfo = getpackagemanager (). queryintentactivities (intent, 0); If (! Resinfo. isempty () {list <intent> targetedincluintents = new arraylist <intent> (); For (resolveinfo info: resinfo) {intent targeted = new intent (intent. action_send); intent. settype ("image/*"); // share the image information type targeted. settype ("text/plain"); activityinfo = info. activityinfo; If (activityinfo. packagename. contains ("Bluetooth") | activityinfo. name. contains ("Bluetooth") {continue; // filter Bluetooth applications} If (activityinfo. packagename. contains ("com. my. activity ") | activityinfo. name. contains ("com. my. activity ") {continue; // filter your application package} If (activityinfo. packagename. contains ("GM") | activityinfo. name. contains ("mail") {targeted. putextra (intent. extra_text, contentdetails);} else if (activityinfo. packagename. contains ("zxing") {targeted. putextra (intent. extra_text, contentdetails);} else {targeted. putextra (intent. extra_text, contentdetails);} targeted. setpackage (activityinfo. packagename); targetedshareintents. add (targeted);} // the title of the Sharing box intent chooserintent = intent. createchooser (targetedshareintents. remove (0), "Select Program sharing"); If (chooserintent = NULL) {return;} chooserintent. putextra (intent. extra_initial_intents, targetedshareintents. toarray (New parcelable [] {}); try {startactivity (chooserintent);} catch (Android. content. activitynotfoundexception ex) {toast. maketext (activity_aboutme.this, "shared application not found", toast. length_short ). show ();}}