I want to make a share button to share a photo from my app directly to the users facebook, assuming they have it installed and are logged in. But the tutorial on the facebook api guide only has one that requires the user to log in, which I don't want to have to do.
I know that startActivity(Intent.createChooser(shareIntent, "Share via"));
will do what I want but I would rather have a facebook specific button that does exactly what the chooser will do but without the user having to open the chooser and select facebook.
I have tried
Intent facebookIntent = new Intent(Intent.ACTION_SEND);
fbIntent.setClassName("com.facebook.katana",packageName);
facebookIntent.setType("image/jpeg");
facebookIntent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(facebookIntent);
where package name comes from getPackageManager().queryIntentActivities(intent, 0)
(There is a bit more code around it but I'd like to keep the code to a minimum)
Is there a way to do this with the facebook api or even without?