2015-09-24 29 views
0

我寫的應用程序爲Android與使用該代碼如何解決Facebook的喜歡按鈕genymoution

Java代碼:

LikeView likeView = (LikeView) findViewById(R.id.likeView); 
likeView.setLikeViewStyle(LikeView.Style.STANDARD); 
likeView.setAuxiliaryViewPosition(LikeView.AuxiliaryViewPosition.INLINE); 

likeView.setObjectIdAndType(
     "https://www.facebook.com/coca-cola", 
     LikeView.ObjectType.OPEN_GRAPH); 

佈局XML:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" 
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    tools:context="example.tmp.ShareActivity"> 

    <com.facebook.share.widget.LikeView 
     android:id="@+id/likeView" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"/> 
</RelativeLayout> 

但是當我點擊喜歡按鈕快速打開和關閉Facebook的用戶界面,並得到這個錯誤

09-24 15:34:37.191 3865-3865/example.tmp I/chromium: [INFO:CONSOLE(1)] "Uncaught Error: Module CircularBuffer has not been defined", source: https://m.facebook.com/connect/dialog/MPlatformLikeJSDialog?app_id=740226516083368&method_args=%7B%22object_id%22%3A%22https%3A%5C%2F%5C%2Fwww.facebook.com%5C%2Fcoca-cola%22%2C%22object_type%22%3A%22open_graph%22%7D&bridge_args=%7B%22action_id%22%3A%2273277a64-873b-4d31-8c14-0d9d064b4271%22%7D&display=touch&android_key_hash=tt4i17WFZzKyTAyD2L8taqrThUk%0A (1) 
09-24 15:34:37.892 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:38.084 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:38.441 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:38.789 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:38.982 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:39.304 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:39.505 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:39.732 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:39.892 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:40.061 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:40.252 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:40.473 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:40.755 3865-3936/example.tmp E/eglCodecCommon: **** ERROR unknown type 0x73000f (glSizeof,80) 
09-24 15:34:40.777 3865-3865/example.tmp I/Choreographer: Skipped 74 frames! The application may be doing too much work on its main thread. 

也許有人知道 - 我怎麼能修復genymoution模擬器中的這個bug?

+0

您能確認您是否已按照[文檔中的說明](https://developers.facebook.com/docs/android/like-button) ?具體來說,你是否正確實現了你的'Activity'的'onActivityResult()',並且你修改了你的'AndroidManifest.xml'就像[Getting Started docs]一樣(https://developers.facebook.com/docs/android/開始)解釋? – derabbink

+0

在您的Android'Activity'中實現的LikeView代碼在哪裏? –

回答

0

今天我有同樣的問題。問題出在用戶錯誤。我試圖用沒有這個應用程序權限的用戶測試LikeView。當我與另一個用戶進行測試時,所有東西都像魅力一樣。因此,請嘗試爲此用戶添加角色權限或在其他帳戶中添加角色權限