I included FB login into my android app and it works fine. Now, I'd like to add the like button. Here is what I did:
- Following exactly the instructions given on https://developers.facebook.com/docs/android/like-button
- I create a LikeView in my layout.xml file:
<com.facebook.widget.LikeView android:id="@+id/LikeView" android:layout_width="wrap_content" android:layout_height="wrap_content"> </com.facebook.widget.LikeView>
- My code looks like this:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_story_reader); uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); LikeView likeView = (LikeView) findViewById(R.id.LikeView); likeView.setObjectId("http://shareitexampleapp.parseapp.com/photo1/"); } ... @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); uiHelper.onActivityResult(requestCode, resultCode, data, null); Log.e("", "requestCode: " + requestCode); Log.e("", " resultCode: " + resultCode); Log.e("", " data: " + data);
- This is the output:
requestCode: 64207 resultCode: 0 data: Intent { (has extras) }
- So my code points to the example page provided by FB. So it is out of question if the destination object id correctly configured.
- I'm not using any test account or similar. I use my real FB acccount for testing.
This is what happens:
- When clicking on the like view a blank page opens and then closes again
- The above stuff is printed to the logcat
- Nothing happened: No like or anything
Why does this 1 to 1 copy of the example not work?