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
Contributor
pxlam15
Posts: 25
Registered: ‎02-04-2013
My Device: Torch

Buttons and Protected boolean navigation clicks

Good evening all,

I have been trying to use a protected boolean navigation click with a fieldchangelistener.  In my protected boolean navigation I send login information to an HTTP post request.  However, it seems that I can't simultaneoulsy send information to a singleton and activate a field change listener going to the next screen.  

ButtonField sendUserInfo = new ButtonField("Login") 

{

protected boolean navigation click (int status, int time)

{

// i have some shenanigans here that send information to a singleton

 

 

}

}

add(sendUserInfo)

sendUserInfo.setChangeListener(new thefieldchangerihavebelow());

 

//I have a field change listener somewhere down here to move it to another screen  

Please use plain text.
Developer
simon_hain
Posts: 16,187
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Buttons and Protected boolean navigation clicks

check if you use networking on the event thread. if that is the case, move it to a separate thread.
see
http://supportforums.blackberry.com/t5/Java-Development/What-is-the-Event-Thread/ta-p/446865
----------------------------------------------------------
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.
@SimonHain on twitter
Please use plain text.
Developer
peter_strange
Posts: 19,607
Registered: ‎07-14-2008
My Device: Not Specified

Re: Buttons and Protected boolean navigation clicks

Also be aware that one normally uses either navigationClick or a change listener for processing events initiated by Fields.  The choice is typically down to style, but I prefer using the change listener because that means the processing code is external to the Field. 

Please use plain text.