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
Regular Contributor
Posts: 92
Registered: ‎01-31-2012
My Device: curve 8520
My Carrier: vodafone
Accepted Solution

automatically clicked

I have an issue here,I need to set a button to be automatically clicked when a screen is being invoked,how can I do that

Developer
Posts: 226
Registered: ‎10-01-2011
My Device: Passport

Re: automatically clicked

I did somehing like this but didn't end up using it for long so I can't be 100% sure it will work well, but I just added a button and set it as the focussed control when the screen is shown. In the OnFucus on the button I injected the click.  You could of course call the event directly instead of injecting.

 

However I would ask why you need to do this, it seems an unusual request and maybe there is a better approach to your code desing if you care to share. 

 

Chris

 

---------------------------------------------------------------------

press LIKE on the right if I helped you

Regular Contributor
Posts: 92
Registered: ‎01-31-2012
My Device: curve 8520
My Carrier: vodafone

Re: automatically clicked

I made a tab with buttons when I enter the screen I should click on any button of them to show details on the screen , if you have other suggestions please tell me
Developer
Posts: 19,633
Registered: ‎07-14-2008
My Device: Not Specified

Re: automatically clicked

As a suggestion, override

 

protected void onUiEngineAttached(boolean attached) {

}

 

for the Screen.  If attached, then just perform whatever processing you would perform if someone pushed the button you wish to be the active Tab.