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
Posts: 209
Registered: ‎11-08-2008
My Device: Not Specified

Problem with roll-over icon.

Hi,

 

Here is my main class of my application...

I am working on BB 4.3 JDE.

 

 

public static void main(String[] args)
 {
       if (args != null && args.length > 0 && args[0].equals("gui"))
        {
           MyApplication theApp = new MyApplication(false);
            theApp.enterEventDispatcher();
        }
        else
        {
            MyApplication theApp = new MyApplication(true);
            theApp.enterEventDispatcher();
        }

}

 

I have gone through the document of multiple entry point of application. And based on that I have set value "gui" to 

project-->property-->Application-->Arguments passed to "static public void main(String args [])"

 

So then it shows the HomeScreen.UpdateIcon and as well Roll over icon. But when i click then it do not start application.

 

But when i set any other value in field at

project-->property-->Application-->Arguments passed to "static public void main(String args [])"

then it do not show application icon,but start application on click.

 

But I want to happen both the events; i.e application should show Application icon and roll over icon, and application should start on click

Thanks and Regards
Highlighted
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Problem with roll-over icon.

The course of this conversation would get you some clue..

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=48953&view=by_date...

 

Cheers.. 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 588
Registered: ‎05-29-2009
My Device: 9100

Re: Problem with roll-over icon.

I did something like this, and it worked out pretty well... 

 

 

public static void main(String[] args) {

        if (args != null && args.length > 0 && args[0].equals("gui")) {
             final Bitmap regIcon = Bitmap.getBitmapResource("icon.png");
             Bitmap icon =       Bitmap.getBitmapResource("icon_roll_over.png");
             HomeScreen.setRolloverIcon(icon);
             HomeScreen.updateIcon(regIcon);

            Main app = new Main();

            boolean isInStartup = ApplicationManager.getApplicationManager() .inStartup();
            if (isInStartup) {
                System.exit(0);
             
            } else {
                app.requestForeground();
            }

            app.enterEventDispatcher();
        }
    }

Developer
Posts: 209
Registered: ‎11-08-2008
My Device: Not Specified

Re: Problem with roll-over icon.

 

Hi Ibarrera,

 

I did your piece of code

 

public static void main(String[] args) {

        if (args != null && args.length > 0 && args[0].equals("gui")) {
             final Bitmap regIcon = Bitmap.getBitmapResource("icon.png");
             Bitmap icon =       Bitmap.getBitmapResource("icon_roll_over.png");
             if(condition)

             {

                      HomeScreen.setRolloverIcon(icon);

             }

             else

             {
                      HomeScreen.updateIcon(regIcon);
             }
            Main app = new Main();

            boolean isInStartup = ApplicationManager.getApplicationManager() .inStartup();
            if (isInStartup) {
                System.exit(0);
             
            } else {
                app.requestForeground();
            }

            app.enterEventDispatcher();
        }
    }

 

But,here, if you have noticed that I want to set ApplicationIcon according to the condition.

But the problem is that when I click on the ApplicationIcon then it sets the Icon;Where as I want to change continously,without clicking,as it does for RollOverIcon.

 

Thanks and Regards