我是否需要在每项活动中加入FacebookSdk.sdkInitialize(getApplicationContext());
?或者只是第一个活动?
答案 0 :(得分:1)
他们要求在Application类onCreate()方法中初始化它。
public class MyApplication extends Application {
// Updated your class body:
@Override
public void onCreate() {
super.onCreate();
// Initialize the SDK before executing any other operations,
FacebookSdk.sdkInitialize(getApplicationContext());
AppEventsLogger.activateApp(this);
}