Get a list of posible app to share content on android -


when use intent.actionsend , android shows dialog, of posibles places send content.

android share list

i know if posible take list of applications ,where can share, , have like:

list<string> shareoptions --> {com.facebook, com.gmail, com.whatever...} 

thank much.

you can this:

list<resolveinfo> rinfo =  getactivity().getpackagemanager().queryintentactivities(createshareintent(),0);  private intent createshareintent() {         intent shareintent = new intent(intent.action_send);         shareintent.putextra(intent.extra_text,"text share");         shareintent.settype("text/plain");         return shareintent;     }   list<string> shareoptions = new arraylist<string> (); 

to list of package name:

for(resolveinfo r:rinfo){  string packagename = r.activityinfo.packagename;  // whatever want here. populate own list view  shareoptions.add(packagename); } 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -