BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-01-2009, 02:37 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2009
Model: 8350i
PIN: N/A
Carrier: telus
Posts: 40
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default pushScreen in the middle of class

Please Login to Remove!

If I push a screen from another class will the code in that class complete before (or while) the new screen is displayed. Or does the remainder of the code after the pushScreen get discarded?
Offline  
Old 11-01-2009, 02:42 PM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2009
Model: 8350i
PIN: N/A
Carrier: telus
Posts: 40
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Maybe I should be more specific. I have a main screen which has a keylistener. When the user presses a key I push the main screen to update the graphics and then call a method to play audio. No matter what I seem to do the audio plays and then the screen updates. I need the graphics to update and then the audio to play. Whats up?
Offline  
Old 11-01-2009, 03:40 PM   #3 (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 are probably trying to acccomplish both tasks in the UI event thread. The screen won't paint until the audio is complete.
Offline  
Old 11-01-2009, 06:22 PM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2009
Model: 8350i
PIN: N/A
Carrier: telus
Posts: 40
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yeah you're right. I've been trying to put the audio in a seperate thread for about the last 2 hours now with no luck (first time). Is there a way to force the screen to repaint?
Offline  
Old 11-01-2009, 07:05 PM   #5 (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

Anything you could do to force a repaint would be behind the original screen push in the event queue, so no.

Maybe you should post a code snippet.
Offline  
Old 11-01-2009, 07:39 PM   #6 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2009
Model: 8350i
PIN: N/A
Carrier: telus
Posts: 40
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks again Doug. I don't think I need the code snippet, I think I need to figure out how to run a seperate thread. I got some code from blackberry docs but can't get it going yet. I'm working on it, learning a lot.
Offline  
Old 11-01-2009, 08:28 PM   #7 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2009
Model: 8350i
PIN: N/A
Carrier: telus
Posts: 40
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Got it. The new thread for the audio worked great.
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





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