How to share predefined text on Facebook via ShareDialog Android

i have a big problem for sharing text via ShareDialog. It seems i can only share predefined links,descriptions... but not text. Is there any other way to share text of Facebook from my Android app. My code is:

FacebookDialog shareDialog = createShareDialogBuilderForLink().build();

 private FacebookDialog.ShareDialogBuilder createShareDialogBuilderForLink() {
    return new FacebookDialog.ShareDialogBuilder(this)

            .setCaption("Here Comes the Boom!!!!")
            .setName("Hello Facebook")
            .setDescription("Here is my description")
            .setLink("http://developers.facebook.com/android");
}

Answers


It's impossible, you have to use the Facebook api to do this.

More informations here: https://stackoverflow.com/a/22123047/2065418


Code for Facebook sharing text/link

public void post(String post_text) {

    Bundle postParam = new Bundle();

    Request.Callback callback = new Request.Callback() {
        @Override
        public void onCompleted(Response response) {

            // shareDialog.dismiss();
            // showPublishResult("Photo Post", response.getGraphObject(),
            // response.getError());
        }
    };
    Session session = createSession();
    postParam.putString("name", post_text);

    postParam.putString("link", "https://developers.facebook.com/android");

    Request request = new Request(session, "me/feed", postParam,
            HttpMethod.POST, callback);

    RequestAsyncTask task = new RequestAsyncTask(request);
    task.execute();

}

Need Your Help

Incompatible Android Studio source structure and gradle error

gradle android-studio android-gradle

The Android Studio version I am using is 0.5.3. I created a project with the IDE. The default file structure is:

how to set focused on searchview when Activity are start?

android android-activity

i want focused on the searchview when redirect from one activity to other activity