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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
myraddin
Posts: 391
Registered: ‎09-12-2008
Accepted Solution

Disabling switch to application

[ Edited ]

Hi all.

The app runs in the background but on ocasions pushes a popup screen.

 

The appextends UIapplication so the application is automatically put on the "switch to application" ribbon.

 

I don't wat to allow someone to switch to my background app.

 

I have two approaches:

1) Disable the app icon showing on the "switch to application" ribbon

- could not find a way to do this (other than to extend Application instead of UIapplication)

2) intercept activate()

I tried doing this:

 

/**
* Overriden to disable SwitchTo handling
*/
public void activate()
{
System.out.println("IGNORE: Somebody used Switch to application.");
// ignore Switch to application
//super.activate();
}

but it doesn't work.

 

Ok then I check the docs and see this:

"The system invokes this method when it brings this application to the foreground. By default, this method does nothing. Override this method to perform additional processing when being brought to the foreground."

 

So, basically, I didn't do anythig with that override :smileysad:

 

Is there a way to make my app transparent to the "Switch to application" events ?

 

 

 

Message Edited by myraddin on 01-23-2009 03:42 PM


"Listen carefully, I shall say this only once"
Please use plain text.
Developer
simon_hain
Posts: 13,754
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Disabling switch to application

i would suggest the first approach, extend application.
use the Ui.getUiEngine methods and global screens.

if you want to pursue the second approach i would guess that you are on your own, your idea sounds pretty rare.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
myraddin
Posts: 391
Registered: ‎09-12-2008

Re: Disabling switch to application

Thanks for the input.

 

Yes, I am currently using this approach, but I think it's fair from my side to let the user know that my app is up an running.

Although I have a second entry for this, the lack of task manager on BB engaged me into such endavour.

 

And it could be managable if only I could get my grip on that activate()... or something similar. I suppose clicking ot the ribbon just invokes some kind of sendToForeground() routine.

 

Anyway, thanks for the comment.

 



"Listen carefully, I shall say this only once"
Please use plain text.
Developer
simon_hain
Posts: 13,754
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Disabling switch to application

if you find something new about the topic i would love to see you sharing the information.
most of the time developing can rely on stuff other people have already done. sometimes not :smileyhappy:
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
peter_strange
Posts: 17,630
Registered: ‎07-14-2008

Re: Disabling switch to application

Note this post:

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=14250&query.id=11...

 

In activate(), I think if you do a requestBackground() you will stay in the background.  However you might want to pop a dialog box telling the user that the application is not accessible.

Please use plain text.
Developer
myraddin
Posts: 391
Registered: ‎09-12-2008

Re: Disabling switch to application

A wierd thread indeed.

 

I will try that approach later on.

 

Thanks all.



"Listen carefully, I shall say this only once"
Please use plain text.
Administrator
MSohm
Posts: 12,957
Registered: ‎07-09-2008
My Carrier: Bell

Re: Disabling switch to application

You can override Application.acceptsForeground() to return false to prevent the application from showing up in the task switch screen.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.