Issues creating login button using Facebook SDK 4.1.2

后端 未结 4 2115
滥情空心
滥情空心 2021-01-24 07:15

I am trying to create an application, which will allow users to sign in via their Facebook accounts. I wanted to use the new Facebook SDK 4.1.2 via eclipse. To use the new SDK i

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-24 07:23

    You initialized facebook sdk in both MainActivity and FacebookFragment, that is not needed, only once is enough and you better initialize it in the superclass, here probably in your MainActivity.

    Remove this line FacebookSdk.sdkInitialize(getActivity()); from FacebookFragemet,

    and swap lines as follows in MainActivity

    FacebookSdk.sdkInitialize(getApplicationContext());
    setContentView(R.layout.activity_main);
    

提交回复
热议问题