android - How to filter ACTION_SEND intent with only facebook and facebook messenger and whatsapp -



android - How to filter ACTION_SEND intent with only facebook and facebook messenger and whatsapp -

how can filter out specific apps when using action_send intent? question has been asked in various ways, haven't been able gather solution based on answers given. can help. provide ability share within app. picture! http://i.imgur.com/6yeufgv.png

as have no command on app available, need hardode dialog yourself, , depending on selection of user, launch action_send intent specifically.

explanations website : http://clickclickclack.wordpress.com/2012/01/03/intercepting-androids-action_send-intents/

create activity "shareactivity" displaying layout listview. implement adapter follow :

public class shareintentlistadapter extends arrayadapter { activity context; object[] items; boolean[] arrows; int layoutid; public shareintentlistadapter(activity context, int layoutid, object[] items) { super(context, layoutid, items); this.context = context; this.items = items; this.layoutid = layoutid; } public view getview(int pos, view convertview, viewgroup parent) { layoutinflater inflater=context.getlayoutinflater(); view row = inflater.inflate(layoutid, null); textview label = (textview) row.findviewbyid(r.id.text1); label.settext(((resolveinfo)items[pos]).activityinfo.applicationinfo.loadlabel(context.getpackagemanager()).tostring()); imageview image = (imageview) row.findviewbyid(r.id.logo); image.setimagedrawable(((resolveinfo)items[pos]).activityinfo.applicationinfo.loadicon(context.getpackagemanager())); return(row); } }

then in "shareactivity", inflate listview, create array containing want display each intent want (i.e logo/name/whatever else fb, fb messenger, twitter etc...), , create shareintentlistadapter array , attach listview.

final step handle onclick method, item clicked , launch intent selected.

android

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -