Auffordern des Benutzers zur Änderung der BlackBerry Messenger-Einstellungen für Ihre Anwendung
Die net.rim.blackberry.api.bbm.platform.BBMPlatformContext-Schnittstelle stellt eine Methode bereit, requestAppSettings(), die Ihrer Anwendung ermöglicht, den entsprechenden BBM-Optionsbildschirm im Vordergrund anzuzeigen, damit der Benutzer die Einstellungen für die Anwendung anpassen kann. Dies ist nützlich, wenn die Anwendung bestimmte Einstellungen erfordert, wie z. B. eine Verbindung zu BBM, oder wenn ein Profilfeld im BBM-Profil des Benutzers angezeigt werden soll.
// Prompt the user to enable the profile box setting
private static void alertIfNotShowingProfile()
{
// Retrieve the settings manager associated with the application
final SettingsManager settings = context.getSettingsManager();
// Retrieve the profile box setting
final int profileBoxSetting =
settings.getSetting(SettingsManager.SETTING_PROFILE_BOX);
// If the profile box setting is disabled, ask the user to change the setting
if(profileBoxSetting == SettingsManager.VALUE_DISABLED)
{
if(Dialog.D_OK == Dialog.ask(Dialog.D_OK_CANCEL, "You have not enabled this
application to appear in your profile. Would you like to enable it?"))
{
// If the user agrees, bring up the BBM options screen
try
{
context.requestAppSettings();
}
catch(ControlledAccessException e)
{
// Code that runs when the BBM platform access status is not
// ACCESS_ALLOWED or is ACCESS_BLOCKED_BY_USER
}
}
}
}
Nächstes Thema: Abrufen von Informationen darüber, wie Ihre Anwendung in BlackBerry Messenger aufgerufen wird
Vorheriges Thema: Abrufen der öffentlichen Verbindungseinstellung für Ihre Anwendung
Waren diese Informationen hilfreich? Senden Sie uns Ihren Kommentar.