Custom Tab Activity

1
2
3
4
5
6
7
8
9
10
<activity
    android:name="com.facebook.CustomTabActivity"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="@string/fb_login_protocol_scheme" />
    </intent-filter>
</activity>
1
2
3
4
5
6
7
8
@Override
protected void onActivityResult(final int requestCode,
final int resultCode, final Intent data){
    super.onActivityResult(requestCode, resultCode, data);
 
    callbackManager.onActivityResult(requestCode, resultCode, data);
    ...
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
if (AccessToken.getCurrentAccessToken() != null){
    ...
}
else{
    AccountKit.getCurrentAccount(new AccountKitCallback<Account>(){
        ...
    })
}
 
if (AccessToken.getCurrentAccessToken() != null){
    Profile profile = Profile.getCurrentProfile();
}
 
if (AccessToken.getCurrentAccessToken() != null){
    Profile currentProfile = Profile.getCurrentProfile();
    if (currentProfile != null){
        displayProfileInfo(currentProfile);
    } else {
        Profile.fetchProfileForCurrentAccessToken();
    }
}