I need to implement custom social sharing dialog for android to share an image from my app to other apps like Instagram, facebook, twitter, photogrid, etc. How can I get the list of such apps where I can share the image file? Also, if the user selects the "Instagram" button then all three sharing options like "Direct", "Feed" and "Story" come in android default social sharing dialog. I want to do the same for all the apps. How to get a list of such apps?
I have tried following code but it doesn't give what I need (Not the separate share options for one app like e.g. "instagram".
public void getAppList(){
final PackageManager pm = getPackageManager();
int social_app_count = 0;
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
Log.d("applist", "Installed package count "+packages.size());
for (ApplicationInfo packageInfo : packages) {
if(!isSystemPackage(packageInfo)) {
social_app_count++;
Log.d("applist", "Installed package :" + packageInfo.packageName);
Log.d("applist", "Source dir : " + packageInfo.sourceDir);
Log.d("applist", "Launch Activity :" + pm.getLaunchIntentForPackage(packageInfo.packageName));
Log.d("applist", "getAllPermissionGroups :" + pm.getAllPermissionGroups(PackageManager.GET_META_DATA));
}
}
Log.d("applist", "User installed package count "+social_app_count);
}