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: 80
Registered: ‎06-06-2011
My Device: bold 9000
My Carrier: airtel
Accepted Solution

Having problem with activity indicator and threads

Hi Everyone,

 

Im new to this forum and to BlackBerry development.

 

I have a activity indicator that im calling using invokelater method but when i want to pop the activity indicator and move to the next screen its giving me illegalstate exception.

bellow is my code.

 

i have created a new thread where on start i enter into a method where the bellow is the starting point.

 

UiApplication.getUiApplication().invokeLater( new Runnable()     {         public void run ()         {                     UiApplication.getUiApplication().pushScreen(prgs);         }     } );

 

after some codes

 

UiApplication.getUiApplication().invokeLater( new Runnable()     {         public void run ()         {             UiApplication.getUiApplication().popScreen(prgs);         }     } );

UiApplication.getUiApplication().pushScreen(new LoginDialog());

 

im getting the illegalstate exception only when i have to push the new screen .

 

Please help me out.

 

Thanks a lot.

krishnan

 

Developer
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE
My Carrier: AIRTEL, BSNL

Re: Having problem with activity indicator and threads

try pushing 1st then pop the previous screen


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Developer
Posts: 80
Registered: ‎06-06-2011
My Device: bold 9000
My Carrier: airtel

Re: Having problem with activity indicator and threads

Thanks for the reply

 

tried that also no use it is still giving me same illegalstate exception only

Developer
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE
My Carrier: AIRTEL, BSNL

Re: Having problem with activity indicator and threads

[ Edited ]

try this.........................

UiApplication.getUiApplication().invokeLater( new Runnable()     {       
            public void run (){
                UiApplication.getUiApplication().pushScreen(new LoginDialog());
                UiApplication.getUiApplication().popScreen(prgs);        
            }     } );

 

or this too..............

UiApplication.getUiApplication().pushScreen(new LoginDialog());

UiApplication.getUiApplication().invokeLater( new Runnable()     {       
            public void run (){              
                UiApplication.getUiApplication().popScreen(prgs);        
            }     } );

 

 


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Developer
Posts: 80
Registered: ‎06-06-2011
My Device: bold 9000
My Carrier: airtel

Re: Having problem with activity indicator and threads

first of all i am really thankfull to you as i am facing this problem from long time.

 

With the first approach of pushing inside the invokelater its going into a infinte loop and activity indicator is coming on top of the next screen.

 

with the second approach of trying to push and then trying to invokelater method then its back to giving illegalstate exception.

 

once again thanks a lot. u would not know how good i feel about getting replies.

Developer
Posts: 80
Registered: ‎06-06-2011
My Device: bold 9000
My Carrier: airtel

Re: Having problem with activity indicator and threads

Sorry for the earlier post i had a mistake in the code when i removed it, then first approach was working fine.

thanks a lot.
Stay in touch
thanks once again
Developer
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE
My Carrier: AIRTEL, BSNL

Re: Having problem with activity indicator and threads

oh...... now it is ok, that previous post confused me if it worked or not :smileyhappy:


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.