我如何使用socialize与fb分享我的评论

时间:2012-02-28 08:16:39

标签: android

如何使用socialize与facebook分享我的评论,我尝试了下面的代码,但它直接进入facebook主页,不分享我的评论......任何人都可以帮助我 这是我的代码,

public class TraSocializeActivity extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String entityKey     = "http://www.getsocialize.com";
        Entity entity = Entity.newInstance(entityKey, "Socialize");
        View actionBarWrapped = Socialize.getSocializeUI().showActionBar(this, R.layout.main, entity);
        setContentView(actionBarWrapped);

        //this is the code for sharing my comments to facebook but its not working it allows the //user to enter the facebook directly
        if(Socialize.getSocialize().isAuthenticated()) {
            //Entity entity1 = Entity.newInstance("http://someurl.com", "My Entity");  
            String comment = "The comment to be added";
            ShareOptions options = new ShareOptions();
            options.setShareLocation(true);
            options.setShareTo(SocialNetwork.FACEBOOK);
            options.setListener(new SocialNetworkListener()
            {
                public void onError(Activity activity, SocialNetwork network, String message, Throwable e)
                {
                }
                public void onBeforePost(Activity activity, SocialNetwork network)
                {
                }
                {                         // Handle before post
                }
                public void onAfterPost(Activity activity, SocialNetwork network)
                {                         // Handle after post
                }
            });
            Socialize.getSocialize().addComment(this, entity, comment, options, new CommentAddListener()
            {
                public void onError(SocializeException error) {
                    // Handle error
                }
                public void onCreate(Comment comment)
                {                         // Handle success
                }
            });
        }
    }
}

1 个答案:

答案 0 :(得分:0)

我会打电话给我们的开发人员今晚给你答案。抱歉耽搁了;刚看到你的问题。 - DROdio