2012-02-28 45 views
0

我如何分享我的意見到Facebook使用社交,我試了下面的代碼,但它直接進入Facebook的主頁,不分享我的意見...任何人都可以幫助我 這裏是我的代碼,我如何分享我的意見fb使用社交

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 
       } 
      }); 
     } 
    } 
} 
+0

當你說它「進入臉書主頁」你的意思是它顯示一個Facebook登錄頁面?如果是這樣,這是正確的行爲。用戶必須通過Facebook進行身份驗證,才能讓您的應用訪問他們的Facebook帳戶以張貼到他們的牆上。 – 2012-04-18 16:18:48

回答

0

我ping通我們的開發人員,讓你的答案在今晚。抱歉耽擱了;只是看到你的問題。 - DROdio