**Using this code you can share any image from your drawable folder**
public void share()
{
Session.openActiveSession(this, true, new Session.StatusCallback() {
// callback when session changes state
@Override
public void call(final Session session, SessionState state, Exception exception) {
if (session.isOpened()) {
if(!session.getPermissions().contains("publish_actions"))
{
session.requestNewPublishPermissions(new Session.NewPermissionsRequest(Aboutcampaign.this, PERMISSIONS));
}
else
{
final String message="YOUR STRING MESSAGE";
// make request to the /me API
/* Request request = Request
.newStatusUpdateRequest(Session.getActiveSession(), message, new Request.Callback() {
@Override
public void onCompleted(Response response) {
showPublishResult(message, response.getGraphObject(), response.getError());
}
});
request.executeAsync();*/
Bitmap image = BitmapFactory.decodeResource(Aboutcampaign.this.getResources(), R.drawable.product_btn);
// Bitmap BckGrnd = BitmapFactory.decodeFile(file);
Request request = Request.newUploadPhotoRequest(Session.getActiveSession(), image, new Request.Callback() {
public void onCompleted(Response response) {
showPublishResult("Shared on Facebook", response.getGraphObject(), response.getError());
}
});
Bundle params = request.getParameters();
// Add the parameters you want, the caption in this case
params.putString("name", message);
// Update the request parameters
request.setParameters(params);
// Execute the request
Request.executeBatchAsync(request);
// request.executeAsync();
}
}
}
});