Usable Screen Size

by murali raju » Tue, 09 Mar 2010 23:18:48 GMT

Sponsored Links
    you can do it by using override method onTouch(), so that u get the
coordinates and calculate the application area.


Usable Screen Size

by murali raju » Tue, 09 Mar 2010 23:24:18 GMT

 or the best way would be use window manager
windowHeight = this.getWindowManager().getDefaultDisplay().getHeight();

this would be ur notification bar height.


Sponsored Links

Usable Screen Size

by neha » Tue, 09 Mar 2010 23:27:47 GMT

 How can i get the usable screen size in android?

By usable screen size i mean the screen size - size of taskbar.
I can easily get the screen size by DisplayMetrics.

DisplayMetrics dm = new DisplayMetrics();
int height = dm.heightPixels;
int width = dm.widthPixels;

How can i get the size of takbar or the usable screen size.


Other Threads

1. Taking picture without preview

If I try to take a picture (with takePicture() method) without calling
startPreview, I get a black image. However, if I try to call autoFocus
without starting preview, it crashes (because it is not possible to
call autoFocus without starting preview).

How can I do to take a picture and not to call startPreview?


2. handling errors in onCreateDialog(..)

I've implemented the onCreateDialog(..) method in my Activity and I'm
working on the error handling.

I wrap all my code in a try-catch so I can handle any errors. This
works great except that after handling an error I must still return a
value from onCreateDialog(..), either a Dialog instance or null. Since
an error has occurred I have no Dialog instance to return so I return

public Dialog onCreateDialog(int id){
    Dialog dialog = null;
        // Exception thrown here.
        dialog = ....
    }catch(Exception e){
        // Error handled here.
        dialog = null;  // <----- What do I do here? -----

The problem is that returning null always results in Android popping
up a "Sorry" dialog error message. Like I said before, I already
handle my own errors so this additional Android "Sorry" dialog pops up
at the same time as my dialog. It's unnecessary and confusing to the
user. There appears to be no way to gracefully return from
onCreateDialog(..) after an error occurs.

I submitted the issue here:
but Romainguy just declined it. He didn't leave a comment so I don't
know why.

My question:
  Why must returning an null result in an error?
  Why can't nulls just be ignored?

Here is my sample code demonstrating how returning null causes an
error both when the dialog is first created and immediately after a
configuration change.


3. merge a rows in column

4. Something goes wrong on vold randomly or due to wifi

5. G1<> PalmPre <> IPhone comparison

6. How to compute the screen size before rendering objects?

7. File Browser on Android Phone