I think there is an easier way to do this, just call the static method setApplicationId com.facebook.Settings.setApplicationId(facebookID);
And you are good to go. No need to create a session manually using Builder and set it up as an active session!
Information about the disadvantage:
The facebookID user interface specified in the settings class will be used by the getMetadataApplicationId com.facebook.internal.Utility method
public static String getMetadataApplicationId(Context context) { Validate.notNull(context, "context"); Settings.loadDefaultsFromMetadata(context); return Settings.getApplicationId(); }
Which, in turn, will be used by all calls to create a session:
Session(Context context, String applicationId, TokenCachingStrategy tokenCachingStrategy, boolean loadTokenFromCache) { // if the application ID passed in is null, try to get it from the // meta-data in the manifest. if ((context != null) && (applicationId == null)) { applicationId = Utility.getMetadataApplicationId(context); } Validate.notNull(applicationId, "applicationId"); . . . }
Greetings.
MAB
source share