我正在使用Facebook SDK 4.8.0和Facebook SDK提供的LikeView 当我点击Like按钮
时,我得到空白页面 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开发人员指示的方式开发
,帮助我解决这个问题