Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 77
Registered: ‎09-02-2010
My Device: torch
Accepted Solution

Dialog alert message fontstyle problem

Hi All,

 

I have interesting thing to get solution from you.

 

When device font style setting changed, automatically third party (any)application(s) Dialog.alert(message) message font style also get change. Intentionally i want my application font style should remain same irrespective of changes in device settings. For this, I have used Family.forName("bbalpha serif"), to remain same the text in my application. But I am unable to make use of same for default Dialog alert box messages.

 

Can anybody give me an idea please.

 

 

Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10

Re: Dialog alert message fontstyle problem

Hi Harinadh,

 

You can do this by creating own dialog and apply font for that and show that dialog.

 

Dialog _dialog = new Dialog(message, choices, values, defaultChoice, bitmap);

 

_dialog.setFont(your font);

 

_dialog.show();

 

Also if you want click events, you can set dialog closed listener.

 

Thanks.

 

New Developer
Posts: 77
Registered: ‎09-02-2010
My Device: torch

Re: Dialog alert message fontstyle problem

Hi

 

Thanks for your reply

 

This custom dialog can't be like Dialog.alert() box. Because to intimate to the user like ' password changed successfully', if we use Dialog.alert(), It waits untill to press ok button before navigating to the next page but where as our custom dialog box never wait to click the ok before navigating to the next screen.

 

I have tried by using this Dialog _dialog = new Dialog(), Since it can't act like Dialog.alert( message), I have posted in forum to get the better idea.

 

for more understanding :

 

{

     Dialog.alert(message);

     UiApplication.getUiApplication().push(new NextScreen());
}

 

here before moving to NextSCreen(), It shows the message, untill user click the ok button, it never navigates to next page.

 

but where as if we use below like

{

   

Dialog _dialog = new Dialog(message, choices, values, defaultChoice, bitmap);

 

_dialog.setFont(your font);

 

_dialog.show();

 

     UiApplication.getUiApplication().push(new NextScreen());

 

}

Here it never wait for user action on dialog box before navigating to NextScreen.

 

I hope, I could reach in this. Please let me know if I am wrong and Possibly to get the better idea in this.

 

 

Developer
Posts: 243
Registered: ‎07-22-2011
My Device: BlackBerry Z10

Re: Dialog alert message fontstyle problem

Hi,

As pradeep said, for your situation you have to use dialogClosedListener().

 

In that u can write your code it means pushing to next screen

Example like this:

 

Dialog _dialog = new Dialog(message, choices, values, defaultChoice, bitmap);

 

_dialog.setFont(your font);

                            _dialog.setDialogClosedListener(new DialogClosedListener()
                            {
                                public void dialogClosed(Dialog dialog,int choice)
                                {
                                    if (choice == Dialog.D_OK)
                                    {

                                            UiApplication.getUiApplication().push(new NextScreen());

                                    }

                               }

                        }

_dialog.show();

 

Regards,

Lakshman K

 

----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.