Codebeispiel: Entfernen eines Elements aus dem Profilfeld des Benutzers
Im folgenden Codebeispiel wird davon ausgegangen, dass die Klasse, die MyUserProfileBoxScreen angezeigt hat, einen Verweis auf das mit der Anwendung verknüpfte BBMPlatformContext-Objekt an den MyUserProfileBoxScreen-Konstruktor übergeben hat.
import net.rim.blackberry.api.bbm.platform.*;
import net.rim.blackberry.api.bbm.platform.profile.*;
import net.rim.device.api.system.*;
net.rim.device.api.ui.component.*;
import java.util.*;
public class MyUserProfileBoxScreen extends MainScreen
{
public MyUserProfileBoxScreen(BBMPlatformContext platformContext)
{
UserProfile userProfile = platformContext.getUserProfile();
UserProfileBox profileBox = userProfile.getProfileBox();
if (profileBox.isAccessible())
{
int[] itemIds = profileBox.getItemIds();
if(itemIds.length >= 1) {
profileBox.removeItem(itemIds[0]);
}
}
}
}
Nächstes Thema: Benutzerprofil-Standort
Vorheriges Thema: Entfernen eines Elements aus dem Profilfeld des Benutzers
Waren diese Informationen hilfreich? Senden Sie uns Ihren Kommentar.