Codevoorbeeld: het gebruikersprofiel ophalen
In het volgende codevoorbeeld wordt aangenomen dat de klasse die MyUserProfileScreen heeft weergegeven, een verwijzing naar het bijbehorende BBMPlatformContext-object van de toepassing in de constructor MyUserProfileScreen heeft doorgegeven.
import net.rim.blackberry.api.bbm.platform.*;
import net.rim.blackberry.api.bbm.platform.profile.*;
import net.rim.device.api.ui.container.*;
import java.util.*;
public class MyUserProfileScreen extends MainScreen
{
public MyUserProfileScreen(BBMPlatformContext platformContext)
{
UserProfile userProfile = platformContext.getUserProfile();
String displayName = userProfile.getDisplayName();
Bitmap displayPicture = userProfile.getDisplayPicture();
String personalMsg = userProfile.getPersonalMessage();
int status = userProfile.getStatus();
String statusMsg = userProfile.getStatusMessage();
}
}
Volgend onderwerp: Het profiel van de gebruiker bijwerken
Vorig onderwerp: Het profiel van de gebruiker ophalen