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
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Device: 9930

Please wait popup during navigation in of two screens

Pleasewait should be displayed on click then data should be loaded. Once the data is loaded, pleasewait poup should be dismissed..how to implement it?

Code:1.At the end of SplashScreen:

UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { try { Thread.sleep(2000); } catch (InterruptedException e) { Dialog.alert(e.getMessage()); } UiApplication.getUiApplication().popScreen(SplashScreen.this); UiApplication.getUiApplication().pushScreen(new ListScreen1()); } } );

2.ListScreen1:

class ListScreen1 extends MainScreen { // // // public ListScreen1() { ObjectListField lf = new ObjectListField() { protected boolean navigationClick(int status, int time) { return true; //HttpRequest //push(new ListScreen2) } }; //httpRequest //addlist } class ListCallBack implements ListFieldCallback { public void drawListRow(final ListField list, final net.rim.device.api.ui.Graphics g, final int index, final int y, final int w) { // } public Object get(ListField list, int index) { //return } public int getPreferredWidth(ListField list) { //return } public int indexOfList(ListField listField, String prefix, int start) { //return } } }

3.ListScreen2:

class ListScreen2 extends MainScreen { // // // public ListScreen2() { ObjectListField lf = new ObjectListField(); /httpRequest //addlist } class ListCallBack implements ListFieldCallback { public void drawListRow(final ListField list, final net.rim.device.api.ui.Graphics g, final int index, final int y, final int w) { // } public Object get(ListField list, int index) { //return } public int getPreferredWidth(ListField list) { //return } public int indexOfList(ListField listField, String prefix, int start) { //return } }

How to manage pleasewait between those classes?? pls help..Its urgent :smileysad: 

Developer
pradeep_ch
Posts: 543
Registered: ‎12-23-2010
My Device: Z10

Re: Please wait popup during navigation in of two screens

Hi Jovinz,

 

Welcome to support forums,

 

See this link,

 

http://supportforums.blackberry.com/t5/Java-Development/Sample-quot-Please-Wait-quot-screen-part-1/t...

 

 

Thanks.

Developer
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Device: 9930

Re: Please wait popup during navigation in of two screens

I have tried it...Bt not working...Its fetching the data bt unable to display in listfield
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Please wait popup during navigation in of two screens

So is your problem with the 'waiting' or are you getting the data and not displaying it correctly?

 

If it is the displaying, then that is a different problem.  Perhaps you can mark this as solved and start a new problem?

 

But before you start a new problem, there are other Threads on here that talk about not being able to display the data that they get from a Server.  have a search for these and look at what those developers have tried.   Perhaps one has already got your solution. 

Developer
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Device: 9930

Re: Please wait popup during navigation in of two screens

My problem is that data is not displaying and i am getting Illegal state Exception...
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Please wait popup during navigation in of two screens

The two are probably related.

 

To debug the IllegalStateException, you need to find out the detail message that you can get by printing e.toString() (where e is the Exception) or diving into the Exception if you are debugging.

 

I'm guessing this is because you are processing the UI update from the background Thread which you got the data on.  Again this is a fairly common problem, look for Threads that talk about the Event Thread. 

 

Anyway, since the Please wait has been resolved, I think you mark this Thread as solved.  Instructions in the Help link near the top if you need them.

 

Try to figure out your IllegalStateException by searching for similar Threads here and researching the Event Thread.  If you can't, then start a new Thread with that problem. 

Developer
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Device: 9930

Re: Please wait popup during navigation in of two screens

One more problem that i am facing regarding this...When i run same app on simulator there is exception thrown..nt not in case of a real devic..
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Please wait popup during navigation in of two screens

"When i run same app on simulator there is exception thrown..nt not in case of a real device"

 

The only way I think this could happen is if the real device was a different OS to the Simulator.  In my experience, some levels of OS let things slide (in other words they will work), that other levels will complain about. 

 

Alternatively, and I've seen this too, you just don't see it on the device because it is not in debugging mode. 

 

Either way, you need to fix it |I think.

Developer
JoVinz
Posts: 255
Registered: ‎05-03-2012
My Device: 9930

Re: Please wait popup during navigation in of two screens