Facebook Like Button点击显示空白页面并自动被解雇

时间:2017-01-25 09:07:48

标签: android facebook facebook-android-sdk

我正在使用Facebook SDK 4.8.0和Facebook SDK提供的LikeView 当我点击Like按钮

时,我得到空白页面

Facebook blank image when click on LIKE button

Facebook LikeView Button

XML中的

      <com.facebook.share.widget.LikeView
        android:id="@+id/likeView"
        android:layout_alignParentTop="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>     
<\ n>在ManiFest中

      <meta-data android:name="com.facebook.sdk.ApplicationName"
        android:value="@string/app_name" />
      <meta-data android:name="com.facebook.sdk.ApplicationId" 
       android:value="@string/facebook_app_id"/>
    <provider                          android:authorities="com.facebook.app.
FacebookContentProviderXXXXXXXX"
        android:name="com.facebook.FacebookContentProvider"
        android:exported="true"/>
    <activity
        android:name="com.facebook.FacebookActivity"
             android:configChanges="keyboard|keyboardHidden|
            screenLayout|screenSize|orientation"
        android:label="@string/app_name" />

在Java中

      likeView = (LikeView) findViewById(R.id.likeView);
         likeView.setLikeViewStyle(LikeView.Style.STANDARD);
             likeView.setAuxiliaryViewPosition(
             LikeView.AuxiliaryViewPosition.INLINE);
        likeView.setObjectIdAndType(
            "https://www.facebook.com/AndroidOfficial/",
            LikeView.ObjectType.PAGE);
        likeView.setOnClickListener(
             new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Log.d(TAG,"Facebook like");
        }
    });
    likeView.setOnErrorListener(new LikeView.OnErrorListener() {
        @Override
        public void onError(FacebookException error) {
            Log.d(TAG,"Facebook error :- " + error.getMessage());
            error.printStackTrace();
        }
    });

请按照Facebook开发人员指示的方式开发

,帮助我解决这个问题

0 个答案:

没有答案