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: 20
Registered: ‎02-20-2009
My Device: Not Specified
Accepted Solution

Focus on screen change

[ Edited ]

Hi

 

I have an issue regarding focus on screen changes:

 

 

If a button has focus on screen A, and the user presses it, I display screen B.

 

Pressing the back button from screen B, screen A is displayed again however no field appears to have the focus.  On the simulator the focus is where you'd expect it to be (ie the button) but on the actual device no field seems to have any focus.

 

 

Edit: The reason it works on the simulator is because I hit return.  If I do this on the device (as opposed to clicking on the centre of the trackball) it works as well.  How could I make it work for both? 

 

 

Cheers

 

 

Dave 

Message Edited by Dave-F on 04-14-2009 09:35 AM
Message Edited by Dave-F on 04-14-2009 10:09 AM
Message Edited by Dave-F on 04-14-2009 10:09 AM
Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: Focus on screen change

Hi,

 

Can you make your question little more clear.

 

I think use can use setFocus() function to set focus on the buttonfield.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Highlighted
Developer
Posts: 20
Registered: ‎02-20-2009
My Device: Not Specified

Re: Focus on screen change

Hello

 

I ended up getting it working by doing:

 

 

protected void onExposed() { setFocus(); }

 

 On screen A which did the trick.  Not sure where the focus would've been otherwise since screen B should've been popped off the stack anyway, but it works :^)

 

Apologies if the question was obvious, I'm new to BlackBerry.

 

Cheers,

 

 

Dave