Hello friends i am facing problem with sharing functionality on facebook wall. I am sharing text and image, which is a captured screen of my application. But i unable to share text using following code. Please help me to solve this problem.
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("image/png");
shareIntent.putExtra(Intent.EXTRA_TITLE, "my awesome caption in the EXTRA_TITLE field");
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "your sharing text");
shareIntent.putExtra(android.content.Intent.EXTRA_STREAM, pngUri); // Share
// the
// image
// on
// Facebook
PackageManager pm = mActivity.getPackageManager();
List<ResolveInfo> activityList = pm.queryIntentActivities(shareIntent, 0);
for (final ResolveInfo app : activityList)
{
if ((app.activityInfo.name).contains(sharingapp))
{
c++;
final ActivityInfo activity = app.activityInfo;
final ComponentName name = new ComponentName(activity.applicationInfo.packageName, activity.name);
shareIntent.addCategory(Intent.CATEGORY_LAUNCHER);
shareIntent.setComponent(name);
startActivity(shareIntent);
break;
}
}