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
savi
Posts: 184
Registered: ‎10-28-2009
My Device: Not Specified

switch application select application device become hang?

hi all

 

 

if i am in any application in my device and from there i click on menu and Switch Application and then Messages,Home Screen and my application(own) comes. if i select my application(own) and click on it..then device become hang. then i click on disconnect call ...then home screen come.

 

i want ,if i click on my application then navigate to my application....

 

 

pls tell me ..why this is happening?

 

thanks

savi

Please use plain text.
Administrator
MSohm
Posts: 14,528
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: switch application select application device become hang?

This can occur if your application is not currently displaying a screen.  The screen will turn white (the background of your UiApplication) and appear to be hung.  In reality there is just nothing to display and nothing to handle input from the user. 

 

Pressing the red End key moves your application to the background.

 

There are a couple of ways to approach this:

 

1.  Ensure your application is always displaying a screen.

2.  Override Application.activate to catch the foreground event and push a screen.

3.  Override Application.acceptsForeground to return false when your application has no GUI to display.  This prevents it from appearing in the task switcher.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
savi
Posts: 184
Registered: ‎10-28-2009
My Device: Not Specified

Re: switch application select application device become hang?

 

hi MSohm

 

 

my application has screens. how i can switch at specific screen?

 

 

 

pls guide me..

 

thanks.

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: switch application select application device become hang?

You need to be aware that if you app is pushed to background, then clicking on the icon should only be making a requestForeground() for your application. This app is already running and should not be restarting.

 

Hard to say without looking at your code, but I'm guessing that you are doing something wrong in your handling of requestForeground().

 

Are you overriding activate() in your UiApplication object?

 

 

 

Please use plain text.
Developer
savi
Posts: 184
Registered: ‎10-28-2009
My Device: Not Specified

Re: switch application select application device become hang?

hi

 

my application is running...

 

i did something like this

 

i wrote this inside main class contructor

 

final FriendsScreen fscreen = new FriendsScreen();
        invokeAndWait(new Runnable() {
            public void run() {
                pushScreen(fscreen);
                
            }
        });

 

now my application is switching but again not commming in switch applciation..

Please use plain text.
Administrator
MSohm
Posts: 14,528
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: switch application select application device become hang?

 


savi wrote:

 

now my application is switching but again not commming in switch applciation..


I'm not sure what you mean there.  Can you elaborate?

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
savi
Posts: 184
Registered: ‎10-28-2009
My Device: Not Specified

Re: switch application select application device become hang?

After wrote this code

 

final FriendsScreen fscreen = new FriendsScreen();
        invokeAndWait(new Runnable() {
            public void run() {
                pushScreen(fscreen);
                
            }
        });

 

 

if i am anywhere in device then first time in Switch Application ,my application come and if i click on it then navigate to my application home screen.but if i again switch application then my application does't show.

 

i hope , now you understood.

 

thanks

Please use plain text.
Administrator
MSohm
Posts: 14,528
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: switch application select application device become hang?

Where is that code being run from?  What do you mean by "my application doesn't show"?  Does it no longer appear in the task switch screen or if not, what do you see when you switch to it?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
savi
Posts: 184
Registered: ‎10-28-2009
My Device: Not Specified

Re: switch application select application device become hang?

i am runing this code in my main class's inside constructor. first time my application show in switch application but next time it does't show, other applicaton shows.

Please use plain text.
Administrator
MSohm
Posts: 14,528
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: switch application select application device become hang?

Has the application closed during this time?  Was any error or exception thrown?

 

If the application remained running it should still appear in the task switcher.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.