Wrong scrren height..

Go down

Wrong scrren height..

Post  sukesh on Wed Sep 26, 2007 4:08 am

Hi
I am getting wrong screen height when using getHeight() on Nokia 6600. I used setFullScreenMode(true) but still it is giving wrong. I also tried sizechanged(int w, int h). But not successful. Can anyone tell me how to use sizechanged properly or any other solution.

Regards
Sukesh

sukesh

Posts : 8
Join date : 2007-09-10

View user profile

Back to top Go down

Re: Wrong scrren height..

Post  guantana on Wed Sep 26, 2007 4:21 am

Sukesh, what are the values that u get in sizeChanged().

I also got the same problem while working with one of my earlier project. Dont use getHeight() and getWidth() because they may be some synchronizatio issues. Do assign height and width that u get in sizeChanged to some global variables. Use these newely assinged values then.

Do let me know for further issue on it.

Guantana
avatar
guantana

Posts : 22
Join date : 2007-09-09
Location : New Delhi, India

View user profile http://guantana.blogspot.com

Back to top Go down

Re: Wrong scrren height..

Post  sukesh on Wed Sep 26, 2007 5:20 am

Thanks. But I tell you what I did.

int width,height;

constructor()
{
setFullScreenMode(true);
}

protected void sizeChanged(int w, int h)
{
width=w;
height=h;
}

After that when I am using width and height, I am not getting the proper values. Is there any problem in this implementation?

Regards
Sukesh

sukesh

Posts : 8
Join date : 2007-09-10

View user profile

Back to top Go down

Re: Wrong scrren height..

Post  Nishtha on Wed Sep 26, 2007 11:24 am

sukesh wrote:Thanks. But I tell you what I did.

int width,height;

constructor()
{
setFullScreenMode(true);
}

protected void sizeChanged(int w, int h)
{
width=w;
height=h;
}

After that when I am using width and height, I am not getting the proper values. Is there any problem in this
implementation?

Regards
Sukesh


Hi Sukesh ,

I can understand your problem even I have faced same problem. So I m giving you the code that I m sure that will work for you.

public Constuctor() {

setFullScreenMode(true);
canvasWidth = getWidth();
canvasHeight = getHeight();
}

public void sizeChanged(int w, int h) {

canvasWidth = getWidth();
canvasHeight = getHeight();
}

The above program will work for every phone. Basically their is a problem with few phones that they don't make proper callbacks of sizeChanged method. Also their is one more problem that sometimes sizechanged method is called by the phones with wrong value of parameter w and h . But try out the above code I m sure it work for u.

thanks
Nishtha.

Nishtha

Posts : 25
Join date : 2007-09-09

View user profile http://sahil-bedi.blogspot.com/

Back to top Go down

Re: Wrong scrren height..

Post  Nishtha on Wed Sep 26, 2007 11:25 am

sukesh wrote:Thanks. But I tell you what I did.

int width,height;

constructor()
{
setFullScreenMode(true);
}

protected void sizeChanged(int w, int h)
{
width=w;
height=h;
}

After that when I am using width and height, I am not getting the proper values. Is there any problem in this
implementation?

Regards
Sukesh


Hi Sukesh ,

I can understand your problem even I have faced same problem. So I m giving you the code that I m sure that will work for you.

public Constuctor() {

setFullScreenMode(true);
canvasWidth = getWidth();
canvasHeight = getHeight();
}

public void sizeChanged(int w, int h) {

canvasWidth = getWidth();
canvasHeight = getHeight();
}

The above program will work for every phone. Basically their is a problem with few phones that they don't make proper callbacks of sizeChanged method. Also their is one more problem that sometimes sizechanged method is called by the phones with wrong value of parameter w and h . But try out the above code I m sure it work for u.

thanks
Nishtha.

Nishtha

Posts : 25
Join date : 2007-09-09

View user profile http://sahil-bedi.blogspot.com/

Back to top Go down

Re: Wrong scrren height..

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum