You mean something like this:

        WindowManager a = this.getWindowManager();
        Display v = a.getDefaultDisplay();
        String s = "Height: " + v.getHeight(); --> display height
        String b = "Widtht: " + v.getWidth(); --> display width

?

On Jun 2, 7:23 am, "Kalyan Kondapally"
<[EMAIL PROTECTED]> wrote:
> Hi Dolan,
>
> I think u miss udestood my Question.I have that in my xml file, before
> drawing my Layout which contains my list view.I would liek to check for some
> conditions and depending on it set the width of the layout(I mean reduce it
> ,not allow it to occupy the whole screen).For this i need to calculate the
> screen size available for my application.
>
> regards,
> Kalyan
>
> On Mon, Jun 2, 2008 at 10:35 AM, dolan kundu <[EMAIL PROTECTED]> wrote:
> > Hi Kalyan,
> > to set the width in whole screen, use
> > android:layout_width="fill_parent"
>
> > Thanks,
> > Dolan.
>
> > On Mon, Jun 2, 2008 at 10:28 AM, Kalyan Kondapally <
> > [EMAIL PROTECTED]> wrote:
>
> >> Hi Dolan,
>
> >> I would like to retrieve the Screen Size so that I could ajust the width
> >> of my Layout and use the remaining to place another image view.
> >> With this it fills the whole screen width isint it??
>
> >> Regards,
> >> Kalyan
>
> >> On Mon, Jun 2, 2008 at 10:23 AM, dolan kundu <[EMAIL PROTECTED]>
> >> wrote:
>
> >>> Hi Kalyan,
>
> >>> To fix the actual size of the screen, try like this way:
>
> >>>                 android:id="@android:id/list"
> >>>                 android:layout_width="fill_parent"
> >>>                 android:layout_height="384dip"
> >>>                 android:layout_weight="1"
> >>>                 android:layout_x ="0px"
> >>>                 android:layout_y = "0px"
>
> >>> Thanks,
> >>> Dolan.
>
> >>> On Sun, Jun 1, 2008 at 11:14 PM, Kalyan <[EMAIL PROTECTED]> wrote:
>
> >>>> Hi,
>
> >>>> I created a simple List view.Now i want to control the width of the
> >>>> List view.
> >>>> I have the following doubts:
> >>>> 1)How can i get the actual size of the screen used by the application.
> >>>> Any one has example code how to use doLayout,onMeasure. I am quite
> >>>> confused when actually we set the size of the layout. I want to resize
> >>>> my LinearLayout which contains the listview,before actually appending
> >>>> the list elements to it.
>
> >>>> Here, is my main.xml
>
> >>>> <?xml version="1.0" encoding="utf-8"?>
> >>>> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/
> >>>> android"
> >>>>    android:id="@+id/container"
> >>>>    android:layout_width="fill_parent"
> >>>>    android:layout_height="fill_parent">
> >>>> <LinearLayout
> >>>>     android:id="@+id/listlayout"
> >>>>    android:orientation="vertical"
> >>>>    android:layout_width="fill_parent"
> >>>>    android:layout_height="fill_parent"
>
> >>>>  <ListView android:id="@+id/android:list"
> >>>>        android:layout_height="fill_parent"
> >>>>         android:layout_width="fill_parent"
> >>>>        android:layout_weight="0"/>
> >>>> </LinearLayout>
>
> >>>> </FrameLayout>
>
> >>>> 2)After resizing the LinearLayout ,if some conditions are satisfied
> >>>> then in the remaing screen space to add another Image viewi.e to the
> >>>> FrameLayout. How can i control the position of the image,to be
> >>>> placed.
>
> >>>> Am i in the right path or do I need to change my Layout structure??
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to