yashika wrote:

> When i [sic] m [sic] using setWidhtHeight(View v,int width,int height) 
> method to set the size of layout throug code this error is occur-
> void is an invalid type for the variable setWidthHeight
> Plz [sic] help me how to solve it.
>
> this is my code-
>
> DO NOT USE TAB CHARACTERS TO INDENT CODE!
 
You provide a code fragment only, so I shall assume something.
 
I assume this fragment comes from inside a method declaration such as 

  public void someMethod() {

>
> Display display = getWindowManager().getDefaultDisplay();
> Point size = new Point();
> display.getSize(size);
> int width = size.x;
> int height = size.y;
>

// WHOOPS! No conclusion to the method before the declaration of the next 
method.

>
> public void setWidthHeight(View v, int width, int height){
>     LayoutParams lp;
>     lp = (LayoutParams) v.getLayoutParams();
>     lp.width = width;
>     lp.height = height;
>     v.setLayoutParams(lp);
>  }
>

There are no brace characters ( "{", "}" )  between the variable 
declarations and 
the method declaration. Read the Java Tutorial.

http://docs.oracle.com/javase/tutorial/java/index.html

Show us a complete code example.
http://sscce.org/

-- 
Lew

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to