Skip to main content

White screen on startup - but doesn't go away!

8 replies [Last post]
nafs
Offline
Joined: 2008-06-10

Ok this has probably got to be the strangest issue ever... note that my code works perfectly fine in ALL the emulators, but fails miserably on the N90.

Basically I see a perpetual startup screen... my startApp() looks like this:

startApp()
{
Display.init( this );
display( getMyMenu() ) //When I replace this with display(new Form()) it works!

}

private void display(Form f) {f.show()}

private MyMenu getMyMeny()
{
if mymenu==null
mymenu=new MyMenu("Welcome",this)
return mymenu
}

This code is as simple as it gets! I've been testing this fo the last 7 hours, thinking what could possibly be the problem... there is nothing strange about MyMenu either, here is what the class essentially looks like

MyMenu extends Form
public MainMenu( final String title, final MIDlet midlet )
{
super( title );
this.midlet = midlet;
init();
}

private void init()
{
choices= new List();
choices.addItem( x);
choices.addItem( y);
choices.addItem( z);
this.addComponent( choices);

//Init the commands
exitCommand = new Command( "Exit", false );
okCommand = new Command( "Ok", true );
this.addCommand( exitCommand );
this.addCommand( okCommand );

this.setCommandListener( new MyMenuListener( this ) );
}
}

Message was edited by: nafs

Message was edited by: nafs

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nafs
Offline
Joined: 2008-06-10

Ok the pseudocode is fixed, heh.

This is getting stranger by the minute... sometimes it works if I restart the application several times. But th LWUIT demo works everytime!

Message was edited by: nafs

nafs
Offline
Joined: 2008-06-10

hang on guys, hang on... I am getting closer to solving this.

It seems I am looking in the wrong place. This code WORKS:

public MyMenu( final String title, final MIDlet midlet )
{
super( title );
this.midlet = midlet;
init();
}

private void init()
{
x= "Hi";
y= "Bye";
z= "Nice";
[b] this.addComponent( new Label( x) );
this.addComponent( new Label( y) );
this.addComponent( new Label( z) );[/b]
}

But this code does NOT work:

public MyMenu( final String title, final MIDlet midlet )
{
super( title );
this.midlet = midlet;
init();
}

private void init()
{
x= "Hi";
y= "Bye";
z= "Nice";
[b] menuChoices = new List();
menuChoices.addItem( x);
menuChoices.addItem( y);
menuChoices.addItem( z);
this.addComponent( menuChoices );[/b]
}

So yea, in other words, the problem has something to do with the List... I noticed in the emulator I get the following message when using List:
[i]using default style - no theme enabled(to enable a theme use - public void setStyleProps(Hashtable themeProps) method)[/i]

Message was edited by: nafs

Shai Almog

Hi,
please refer to some of the stuff we wrote about testing on devices.
We can't debug pseudo code for you, if you get a white screen, black
screen etc... you probably got an exception.

Just catch it and show it using a dialog since LWUIT works on this
device. Wrap all suspect lines in try/catch of *Throwable* and show
it using a dialog.

If this fails too you can use the MIDP Form class to display errors
caught, there was a posting about this in a previous thread.

Thanks,
Shai.

> hang on guys, hang on... I am getting closer to solving this.
>
> It seems I am looking in the wrong place. This code WORKS:
>
> public MyMenu( final String title, final MIDlet midlet )
> {
> super( title );
> this.midlet = midlet;
> init();
> }
>
> private void init()
> {
> x= "Play Music!";
> y= "Community Player";
> z= "About";
> [b] this.addComponent( new Label( x) );
> this.addComponent( new Label( y) );
> this.addComponent( new Label( z) );[/b]
> }
>
> But this code does NOT work:
>
> public MyMenu( final String title, final MIDlet midlet )
> {
> super( title );
> this.midlet = midlet;
> init();
> }
>
> private void init()
> {
> x= "Play Music!";
> y= "Community Player";
> z= "About";
> [b] menuChoices = new List();
> menuChoices.addItem( playMusic );
> menuChoices.addItem( communityPlayer );
> menuChoices.addItem( about );
> this.addComponent( menuChoices );[/b]
> }
> [Message sent by forum member 'nafs' (nafs)]
>
> http://forums.java.net/jive/thread.jspa?messageID=282460
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

nafs
Offline
Joined: 2008-06-10

That was not pseudocode!

But anyway guys, I fixed the problem... you cannot believe if you see the solution! Let the code talk.

[b]Doesnt work:[/b]
menuChoices = new List();
menuChoices.addItem( x);
menuChoices.addItem( y);
menuChoices.addItem( z);
this.addComponent( menuChoices );

[b]Works!:[/b]
String[] obs = { x, y, z};
menuChoices = new List( obs );
this.addComponent( menuChoices );

Yea, I so totally confused... I dont know why this solution works but it does! Been at this for 15 hours+ now!! I am happy, but not too happy :P

chen

Hi nafs,
Seems like we have some sort of a race condition that exists in your
LWUIT version.
Later today we will release a new version that suppose to resolve your
issues.

Regards,
Chen

lwuit-users@mobileandembedded.org wrote:
> That was not pseudocode!
>
> But anyway guys, I fixed the problem... you cannot believe if you see the solution! Let the code talk.
>
> [b]Doesnt work:[/b]
> menuChoices = new List();
> menuChoices.addItem( x);
> menuChoices.addItem( y);
> menuChoices.addItem( z);
> this.addComponent( menuChoices );
>
> [b]Works!:[/b]
> String[] obs = { x, y, z};
> menuChoices = new List( obs );
> this.addComponent( menuChoices );
>
>
> Yea, I so totally confused... I dont know why this solution works but it does! Been at this for 15 hours+ now!! I am happy, but not too happy :P
> [Message sent by forum member 'nafs' (nafs)]
>
> http://forums.java.net/jive/thread.jspa?messageID=282471
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Francis De Brabandere

there's a bug in the pseudo code...

private void getMyMeny()
{
if mymenu==null
*mymenu =* new MyMenu("Welcome",[b]this[/b])
return mymenu
}

On Wed, Jun 25, 2008 at 5:03 AM, wrote:
> Ok this has probably got to be the strangest issue ever... note that my code works perfectly fine in ALL the emulators, but fails miserably on the N90.
>
> Basically I see a perpetual startup screen... my startApp() looks like this:
>
> startApp()
> {
> Display.init( this );
> [b]display( getMyMenu() )[/b] //When I replace this with display(new Form()) it works!
>
> }
>
> private void display(Form f) {f.show()}
>
> private void getMyMeny()
> {
> if mymenu==null
> new MyMenu("Welcome",[b]this[/b])
> return mymenu
> }
>
> This code is as simple as it gets! I've been testing this fo the last 7 hours, thinking what could possibly be the problem... there is nothing strange about MyMenu either, here is what the class essentially looks like
>
> MyMenu extends Form
> public MainMenu( final String title, final MIDlet midlet )
> {
> super( title );
> this.midlet = midlet;
> init();
> }
>
> private void init()
> {
> choices= new List();
> choices.addItem( x);
> choices.addItem( y);
> choices.addItem( z);
> this.addComponent( choices);
>
> //Init the commands
> exitCommand = new Command( "Exit", false );
> okCommand = new Command( "Ok", true );
> this.addCommand( exitCommand );
> this.addCommand( okCommand );
>
> this.setCommandListener( new MyMenuListener( this ) );
> }
> }
> [Message sent by forum member 'nafs' (nafs)]
>
> http://forums.java.net/jive/thread.jspa?messageID=282403
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>

--
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Matteo Mazzotti

I can confirm having the same issue with my Motorola Razr V3x. I haven't
extensively tested it though, as at the moment I'm focusing on completing
the application and testing with emulators. What is sure is that this
behaviour appeared as soon as I "complicated" my code... Anyhow, as I said,
not having tested enough, I cannot be of help.

Regards
Matteo

> -----Messaggio originale-----
> Da: Francis De Brabandere [mailto:francisdb@gmail.com]
> Inviato: mercoledì 25 giugno 2008 8.36
> A: users@lwuit.dev.java.net
> Oggetto: Re: White screen on startup - but doesn't go away!
>
> there's a bug in the pseudo code...
>
> private void getMyMeny()
> {
> if mymenu==null
> *mymenu =* new MyMenu("Welcome",[b]this[/b]) return mymenu }
>
> On Wed, Jun 25, 2008 at 5:03 AM,
> wrote:
> > Ok this has probably got to be the strangest issue ever...
> note that my code works perfectly fine in ALL the emulators,
> but fails miserably on the N90.
> >
> > Basically I see a perpetual startup screen... my startApp()
> looks like this:
> >
> > startApp()
> > {
> > Display.init( this );
> > [b]display( getMyMenu() )[/b] //When I replace this with
> display(new Form()) it works!
> >
> > }
> >
> > private void display(Form f) {f.show()}
> >
> > private void getMyMeny()
> > {
> > if mymenu==null
> > new MyMenu("Welcome",[b]this[/b])
> > return mymenu
> > }
> >
> > This code is as simple as it gets! I've been testing this
> fo the last
> > 7 hours, thinking what could possibly be the problem... there is
> > nothing strange about MyMenu either, here is what the class
> > essentially looks like
> >
> > MyMenu extends Form
> > public MainMenu( final String title, final MIDlet midlet )
> > {
> > super( title );
> > this.midlet = midlet;
> > init();
> > }
> >
> > private void init()
> > {
> > choices= new List();
> > choices.addItem( x);
> > choices.addItem( y);
> > choices.addItem( z);
> > this.addComponent( choices);
> >
> > //Init the commands
> > exitCommand = new Command( "Exit", false );
> > okCommand = new Command( "Ok", true );
> > this.addCommand( exitCommand );
> > this.addCommand( okCommand );
> >
> > this.setCommandListener( new MyMenuListener(
> this ) );
> > }
> > }
> > [Message sent by forum member 'nafs' (nafs)]
> >
> > http://forums.java.net/jive/thread.jspa?messageID=282403
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> > For additional commands, e-mail: users-help@lwuit.dev.java.net
> >
> >
>
>
>
> --
> http://www.somatik.be
> Microsoft gives you windows, Linux gives you the whole house.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Shai Almog

Many issues occur between emulator and devices. Since you showed me
only pseudo code and not actual code its a bit hard to distinguish
what went wrong e.g.:
getMyMeny is void and doesn't actually assign to mymenu which is an
issue I don't think you have in the code...

Make sure the jar gets properly built and LWUIT is properly packaged
into it.
Try obfuscating which sometimes helps on some devices.

Thanks,
Shai.

> Ok this has probably got to be the strangest issue ever... note
> that my code works perfectly fine in ALL the emulators, but fails
> miserably on the N90.
>
> Basically I see a perpetual startup screen... my startApp() looks
> like this:
>
> startApp()
> {
> Display.init( this );
> [b]display( getMyMenu() )[/b] //When I replace this with display
> (new Form()) it works!
>
> }
>
> private void display(Form f) {f.show()}
>
> private void getMyMeny()
> {
> if mymenu==null
> new MyMenu("Welcome",[b]this[/b])
> return mymenu
> }
>
> This code is as simple as it gets! I've been testing this fo the
> last 7 hours, thinking what could possibly be the problem... there
> is nothing strange about MyMenu either, here is what the class
> essentially looks like
>
> MyMenu extends Form
> public MainMenu( final String title, final MIDlet midlet )
> {
> super( title );
> this.midlet = midlet;
> init();
> }
>
> private void init()
> {
> choices= new List();
> choices.addItem( x);
> choices.addItem( y);
> choices.addItem( z);
> this.addComponent( choices);
>
> //Init the commands
> exitCommand = new Command( "Exit", false );
> okCommand = new Command( "Ok", true );
> this.addCommand( exitCommand );
> this.addCommand( okCommand );
>
> this.setCommandListener( new MyMenuListener( this ) );
> }
> }
> [Message sent by forum member 'nafs' (nafs)]
>
> http://forums.java.net/jive/thread.jspa?messageID=282403
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net