2013-01-04 72 views
1

我正在使用Facebook SDK 3.0 for Android。android facebook sdk 3.0自定义按钮

自定义如何让喜欢按钮

Request request = new Request(session, page_id + "/likes", null, HttpMethod.POST, new Callback() 
{ 
    @Override 
    public void onCompleted(Response response) 
    { 
     Log.i(DEBUG_TAG, response.toString()); 
     // TODO Auto-generated method stub 
     if (response.getGraphObject() != null) 
     { 
      //Log.i(DEBUG_TAG, response.toString()); 
     } 
    } 
}); 
RequestAsyncTask task = new RequestAsyncTask(request); 
task.execute(); 

PAGE_ID = 417732304946490

有OAuthException (#3)应用程序不必做此API调用的能力。

没有办法在应用程序中使用吗?

+0

http://stackoverflow.com/questions/5935034/integrate-facebook-with-like-button-in-android-and-iphone – Gridtestmail

回答

3

Facebook图形API不提供该功能喜欢facebook页面。相反,您可以打开一个包含页面网址的网页视图,以便您可以登录并喜欢您的页面。

// To open webview 
String url = "your page URL"; 
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); 
startActivity(i);