Chad Schultz
Chad Schultz

Reputation: 7860

Facebook UI for making a wall post?

Note: I'm using version 3.0.2.b of the Facebook Android SDK. I don't want to use any deprecated classes/methods.

Is there a standardized way to prompt the user for text to enter in a wall post--such as when sharing a photo?

FBDialog is deprecated. I don't see anything else obvious in the Android SDK Reference that would have such a UI. Even the tutorial to publish a wall post assumes you already have the string you want to publish.

It's just odd that they provide the full sign-in dialog, but would leave it to the developers to create the UI for likes, sharing, wall posts, etc.

So again, my question is--do I need to create my own UI to prompt the user to enter the message they want published to their wall, or is there something in the SDK to standardize that?

Upvotes: 0

Views: 627

Answers (1)

Pavlos
Pavlos

Reputation: 2181

You should make a DialogListener and use it properly when accessing the facebook.dialog() method.

See this article for more help: http://www.androidhive.info/2012/03/android-facebook-connect-tutorial/

public void postToWall() {
// post on user's wall.
facebook.dialog(this, "feed", new DialogListener() {

    @Override
    public void onFacebookError(FacebookError e) {
    }

    @Override
    public void onError(DialogError e) {
    }

    @Override
    public void onComplete(Bundle values) {
    }

    @Override
    public void onCancel() {
    }
});
}

http://www.androidhive.info/wp-content/uploads/2012/05/android_facebook_posting_to_wall.png

Or you can create your own function that creates a dialog with a TextView inside where the user inserts it's own message and then pass this message to the Facebook object inside the Bundle with the parameters! <- This is a WorkAround if you dont want to use the deprecated Listener!

Upvotes: 1

Related Questions