Android SDK Version
  • java.lang.Object
    • com.facebook.Profile

public final class Profile
extends java.lang.Object
This class represents a basic Facebook profile.
Field Summary
Modifier and TypeField and Description
static <any>CREATOR 
Constructor Summary
Constructor and Description
Profile(java.lang.String id, java.lang.String firstName, java.lang.String middleName, java.lang.String lastName, java.lang.String name, Uri linkUri)
Contructor.
Method Summary
Modifier and TypeMethod and Description
intdescribeContents() 
booleanequals(java.lang.Object other) 
static voidfetchProfileForCurrentAccessToken()
Fetches and sets the current profile from the current access token.
static ProfilegetCurrentProfile()
Getter for the profile that is currently logged in to the application.
java.lang.StringgetFirstName()
Getter for the first name of the profile.
java.lang.StringgetId()
Getter for the id of the profile.
java.lang.StringgetLastName()
Getter for the last name of the profile.
UrigetLinkUri()
Getter for the link of the profile.
java.lang.StringgetMiddleName()
Getter for the middle name of the profile.
java.lang.StringgetName()
Getter for the name of the profile.
UrigetProfilePictureUri(int width, int height)
Getter for the Uri of the profile picture.
inthashCode() 
static voidsetCurrentProfile(Profile profile)
Setter for the profile that is currently logged in to the application.
voidwriteToParcel(Parcel dest, int flags) 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Field Detail

CREATOR

public static final <any> CREATOR
Constructor Detail

Profile

public Profile(java.lang.String id,
               java.lang.String firstName,
               java.lang.String middleName,
               java.lang.String lastName,
               java.lang.String name,
               Uri linkUri)
Contructor.
Parameters:
id - The id of the profile.
firstName - The first name of the profile. Can be null.
middleName - The middle name of the profile. Can be null.
lastName - The last name of the profile. Can be null.
name - The name of the profile. Can be null.
linkUri - The link for this profile. Can be null.
Method Detail

getCurrentProfile

public static Profile getCurrentProfile()
Getter for the profile that is currently logged in to the application.
Returns:
The profile that is currently logged in to the application.

setCurrentProfile

public static void setCurrentProfile(Profile profile)
Setter for the profile that is currently logged in to the application. If the access token is invalidated, the current profile will not be updated. It's only updated when there is an explicit logout, login or when permissions change via the LoginManager.
Parameters:
profile - The profile that is currently logged in to the application.

fetchProfileForCurrentAccessToken

public static void fetchProfileForCurrentAccessToken()
Fetches and sets the current profile from the current access token.
This should only be called from the UI thread.

getProfilePictureUri

public Uri getProfilePictureUri(int width,
                                int height)
Getter for the Uri of the profile picture.
Parameters:
width - The desired width for the profile picture.
height - The desired height for the profile picture.
Returns:
The Uri of the profile picture.

getId

public java.lang.String getId()
Getter for the id of the profile.
Returns:
id of the profile.

getFirstName

public java.lang.String getFirstName()
Getter for the first name of the profile.
Returns:
the first name of the profile.

getMiddleName

public java.lang.String getMiddleName()
Getter for the middle name of the profile.
Returns:
the middle name of the profile.

getLastName

public java.lang.String getLastName()
Getter for the last name of the profile.
Returns:
the last name of the profile.

getName

public java.lang.String getName()
Getter for the name of the profile.
Returns:
the name of the profile.

getLinkUri

public Uri getLinkUri()
Getter for the link of the profile.
Returns:
the link of the profile.

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

describeContents

public int describeContents()

writeToParcel

public void writeToParcel(Parcel dest,
                          int flags)