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
Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd
Accepted Solution

blackberry requestbackground

Hi,

In my blackberry app first splash comes then main screen. in onclose event of mainscreen i have request background my app. it works but after that splash does'nt come

any one have any idea that if we request background app how can splash will be displayed first ?

Developer
Posts: 16,676
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: blackberry requestbackground

you can handle the foreground event using http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/ui/UiApplication.html#activate...
----------------------------------------------------------
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
Developer
Posts: 19,628
Registered: ‎07-14-2008
My Device: Not Specified

Re: blackberry requestbackground

Sorry, I am not clear on what you are actually seeing and what you expect to see. 

 

Can you describe, in a time sequence, what you would like to happen and in separate time sequence, what you actually see.

 

For example

 

What I happens currently:

1. see Home screen, click on icon.

2. see splash screen displays for 5 seconds

3. see main screen

4. close main screen - see BlackBerry Home screen

5. click on icon .....

...

 

 

What I would like to see:

1. click on icon, see

...

 

Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: blackberry requestbackground

i used this in my main method class and my screen is showing 2 times

public class MyApp extends WebtrendsUiApplication
{
	static MainScreen splashScreen = null;
	
    public static void main(String[] args)
    {
        // Create a new instance of the application and make the currently
        // running thread the application's event dispatch thread.
        MyApp theApp = new MyApp();       
        theApp.enterEventDispatcher();
    }
    
    public MyApp()
    {        
    	//addRealtimeClockListener(this);
    	splashScreen = new splashScreen();
    	pushScreen(splashScreen);
    	
    }

	public void activate(){
		
			
			splashScreen = new splashScreen();
			pushScreen(splashScreen);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			System.out.println("first error=="+e.toString());
			e.printStackTrace();
		}
		System.out.println("activate====================");
	}
	
}

 

 

Developer
Posts: 16,676
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: blackberry requestbackground

remove the splashscreen from the constructor, activate() is also called there.

if you would debug your code you could see that yourself.
----------------------------------------------------------
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
Developer
Posts: 19,628
Registered: ‎07-14-2008
My Device: Not Specified

Re: blackberry requestbackground

Can you tell us excatly what you would like to see and what you are currently seeing?

 

Remember activate() is also called during application start up. 

Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: blackberry requestbackground

i'll try to clear it more

i run the app first time it shows me splash screen for 3sec, 

then main screen is showing and when i close the main screen , that will goes to background , works fine

now when i run the app again it shows me main screen not starting from splash screen

Developer
Posts: 19,628
Registered: ‎07-14-2008
My Device: Not Specified

Re: blackberry requestbackground

What you are telling us does  not possible from the code you have shown us above.  Can you debug your activate and tell us if the splash screen push is actually executed. 

 

I think the idea of showing a splash screen all the time is a bad one, I would only show the splash screen when I had to to get some assets scaled for example. 

Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: blackberry requestbackground

showing a splash screen all the time is my requirement,plz guide me
Developer
Posts: 16,676
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: blackberry requestbackground

remove the splashscreen from the constructor, show it only in activate()
----------------------------------------------------------
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