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
Developer
Posts: 142
Registered: ‎08-02-2009
My Device: Z10
My Carrier: T-Mobile
Accepted Solution

Terms of Service Dialog

Dear,

 

I am wondering how to implement such a Terms of service screen the App World has.

 

I tried to make a Class extending Dialog and build it but how can I open it at the startup?

 

I want to show it if possible before the first screen is pushed.

 

I have no problem to decide whether it is the first application start or not, this is all already done.

But I have problems showing the Dialog without an application screen pushed already.

 

And how do I close the application correctly if the user declines?

 

 

Best regards,

Bullety

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Terms of Service Dialog

If you absolutely have to push the TOS dialog prior to the first app screen, then you will have to use pushModal() with the "GLOBAL" property.

 

I would suggest ditching the Dialog class and making your own TOS dialog using PopupScreen with a RichTextField for the TOS text. You'll want to place two buttons, "Accept" and "Decline".

 

You will provide a getResponse() (or whatever) method that returns the value of the button (like 0 = Accetpt, 1 =  Decline). If the response is decline, you will call System.exit(0)

 

 

 

 

Highlighted
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: Terms of Service Dialog

Just call the dialog before you push the next screen. There is nothing to stop you from doing this...


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 142
Registered: ‎08-02-2009
My Device: Z10
My Carrier: T-Mobile

Re: Terms of Service Dialog

Thanks RexDoug and Ebscer,

 

I got it working as RexDoug described.

 

 

Best regards,

 

Bullety