0

Do I need to put FacebookSdk.sdkInitialize(getApplicationContext()); in every activity? Or just the first activity?

AlanSTACK
  • 5,525
  • 3
  • 40
  • 99

1 Answers1

1

They are asking to initialize it in Application class onCreate() Method.

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);
}

Link to the original answer

Community
  • 1
  • 1