사용자에게 프로그램에 대한 BlackBerry Messenger 설정 변경을 알리는 메시지 표시
net.rim.blackberry.api.bbm.platform.BBMPlatformContext 인터페이스는 사용자가 프로그램 설정을 조정할 수 있도록 프로그램의 BBM™ 옵션 화면을 전경으로 가져오는 requestAppSettings() 메소드를 제공합니다. 이 메소드는 프로그램에 BBM 연결 등의 특정 설정이 필요하거나 사용자 BBM 프로필의 프로필 상자를 표시할 경우에 유용합니다.
// 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
}
}
}
}