Do I need to put FacebookSdk.sdkInitialize(getApplicationContext());
in every activity? Or just the first activity?
Asked
Active
Viewed 173 times
1 Answers
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);
}

Community
- 1
- 1

Фред Генкин
- 163
- 1
- 8
-
but do I need to initialize it multiple times in different activities? – AlanSTACK May 22 '17 at 06:13