screen size of emulator?

by mmkr » Thu, 10 Sep 2009 11:04:56 GMT

Sponsored Links

How can i get the screen size of my emulator?
i used

Display display = ((WindowManager) getSystemService
        int width = display.getWidth();

But it gives me different values each time. How to find the exact

screen size of emulator?

by Dianne Hackborn » Thu, 10 Sep 2009 11:35:54 GMT

 You generally don't, your views get told the size they should be as part of
the view hierarchy layout.  Directly getting the size of the display is not
recommended, because it may have no relation to the actual space your UI has
available (such as if there are other screen decorations around, like a task
switcher or who knows what).

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


Sponsored Links

Other Threads

1. sync error -- local changes


I am trying to sync with repo. I have done the sync for last march 5th
(first time). After that I build the source many time and today I
tried to sync with the repo. But I got the local changes error. This
is the error I got when I sync with the repo. Can any one tell me how
to resolve this.

 subcmds/        |   11 ++-
 subcmds/          |   85 ++++++++++++-----
 subcmds/        |    3 -
 18 files changed, 919 insertions(+), 127 deletions(-)
 create mode 100644
 create mode 100644 subcmds/
 create mode 100644 subcmds/
 create mode 100644 subcmds/
 create mode 100644 subcmds/
info: Restarting repo with latest version
Fetching projects: 100% (114/114), done.
Syncing work tree:  40% (45/112)  error: You have local changes to
'tools_v2/build/make/'; cannot switch branches.

Thanks in advance,

2. bottom Tabview

       I am  created a Tab view ,in this the tabs are  in top side.
But i  need a tab view which  displays the tabs in the bottom ,can
anybody can give me a code or related link to this one.

3. Performance test cases

4. Writing PerformanceTestCases

5. SDK 1.5 on VISTA - start emulator with no success

6. Can't use the findViewById() in an second view

7. related scrollbar