BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-22-2010, 11:54 AM   #1 (permalink)
New Member
 
Join Date: May 2009
Model: 8100
PIN: N/A
Carrier: airtel
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Too many threads error

Please Login to Remove!

Hi
I am developing an application for BlackBerry with around 20 -25 MainScreens after navigating through the screens for some time the application crashes with too many threads exception. I am using invokeLater to push each screen
any way to resolve this issue ??
Offline  
Old 03-22-2010, 11:58 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Why do you have 20-25 main screens pushed at once?

Why are you using invokeLater() to push screens?

Maybe you need to rethink your app architecture?
Offline  
Old 03-22-2010, 12:15 PM   #3 (permalink)
New Member
 
Join Date: May 2009
Model: 8100
PIN: N/A
Carrier: airtel
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Dougsg38p View Post
Why do you have 20-25 main screens pushed at once?

Why are you using invokeLater() to push screens?

Maybe you need to rethink your app architecture?

My application is a having 23 different screens and based on the states different screens need to be pushed.
The overall architecture is as follows

MainScreen screen;
screen = mainScreen1();
screen = mainScreen2();
screen = mainScreen3();
............
screen = mainScreen20();

invokeLater(){
pushScreen(screen);
}

This is how we had implemented. Do u have any suggestion for this implementation.
Offline  
Old 03-22-2010, 01:48 PM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

You should instantiate a screen when you need it.

You should push the screen when the workflow requires the screen, and pop it if you navigate away from the screen.

It's OK to drill down a few screens deep, but pop them when you "back out" of each screen.
Offline  
Old 03-22-2010, 02:02 PM   #5 (permalink)
New Member
 
Join Date: May 2009
Model: 8100
PIN: N/A
Carrier: airtel
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Dougsg38p View Post
You should instantiate a screen when you need it.

You should push the screen when the workflow requires the screen, and pop it if you navigate away from the screen.

It's OK to drill down a few screens deep, but pop them when you "back out" of each screen.
All the 23 screns are not initialized in one shot

its actually as follows

static MainScreen screen;-global variable





swtich (main_State){

case 1:screen = new MainScreen1();

break;

case 2: screen = new MainScreen2()

.....



invokeLater(){

pushScreen(screen);

}

I am not popping the screens as i need the back key functionality. Is it because of this the issue is coming ??
Offline  
Old 03-22-2010, 02:37 PM   #6 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Why guess? Open the Threads view in the debugger.

Also, please refrain from simultaneously posting in this forum AND the RIM forum. One or the other...
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

SMPTE Output Studio 16 Extras The Complete SMPTE Generator For Your Amiga
$14.99
SMPTE Output Studio 16 Extras The Complete SMPTE Generator For Your Amiga picture23 WAY "D" SHELL HOOD DB23 D23 DB23F DB23M FOR COMMODORE AMIGA CONNECTORS - RARE
$2.55
23 WAY Toshiba TMP68HC000P-16 16mhz 68000 CPU Chip, Amiga Atari Apple Mac
$22.0
Toshiba TMP68HC000P-16 16mhz 68000 CPU Chip, Amiga Atari Apple Mac pictureAMIGA AMIGA A107-335D RQAUS1
$36.1
AMIGA AMIGA A107-335D RQAUS1 pictureCommodore AMIGA CSG 8520 Chip IC 500/A500+/A2000 CDTV - NEW
$12.99
Commodore AMIGA CSG 8520 Chip IC  500/A500+/A2000 CDTV - NEW picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.