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: 196
Registered: ‎12-14-2009
My Device: Not Specified
Accepted Solution

Update Text field on Navigation click

[ Edited ]

When I use a regular ButtonField and put:

 

protected boolean navigationClick(int status, int time) {
	 			   
	     			mytextfield.setText("Sending Info...");
	     		
					return true;
					}  

 it works before the field change listener does stuff on the internet.

 

But when I used the same on a custom button:

 

protected boolean navigationClick(int status, int time) {
	 			   
	     			mytextfield.setText("Sending Info...");
	     			fieldChangeNotify(1);
					return true;
					}  

It won't update the text field and the internet stuff blocks that and then it updates the text field to something else. But I want that "Sending Info..." up there. I tired the synchronized event lock. I tried the invoke later too. What's going on?

Developer
Posts: 196
Registered: ‎12-14-2009
My Device: Not Specified

Re: Update Text field on Navigation click

I solved it by putting:

 

	UiApplication.getUiApplication().invokeLater(new Runnable()
	    {
	        public void run()
	        {
	        internet stuff;
                }
	    }
                                                      );

 the internet stuff in that instead of the setText.