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. Webview crashes on select box or any Dialog

I have an application where clicking on an item in a list shows
webview with javascript injected.I need to save the webview object so
that when the user presses the same item again the existing webview is
shown instead of reloading it and injecting the javascript again.I am
able to save the webview object in Arraylist of webview inside the
application class.

I check whether the item already exists in the Arraylist and if it do
exists take the corresponding object and set the object as the content
of the activity as shown below.

 temp_WebView=new WebView(this);
     ViewGroup parent = (ViewGroup)

This works fine but when clicking on any of the select box inside the
webview where a dialog is populated it gets crashed  with the
following error,

WARN/WindowManager(60): Attempted to add application window with
unknown token HistoryRecord{4506d1e8}.

 DEBUG/AndroidRuntime(500): Shutting down VM

 WARN/dalvikvm(500): threadid=1: thread exiting with uncaught
exception (group=0x4001d800)
 ERROR/AndroidRuntime(500): FATAL EXCEPTION: main
 ERROR/AndroidRuntime(500): android.view.WindowManager
$BadTokenException: Unable to  add window -- token
android.os.BinderProxy@45034510 is not valid; is your activity
 ERROR/AndroidRuntime(500): at
 ERROR/AndroidRuntime(500): at

 ERROR/AndroidRuntime(500):  at

 ERROR/AndroidRuntime(500):     at android.view.Window

 ERROR/AndroidRuntime(500):     at

 ERROR/AndroidRuntime(500):     at android.webkit.WebView

 ERROR/AndroidRuntime(500):     at

 ERROR/AndroidRuntime(500):     at

 ERROR/AndroidRuntime(500):     at android.os.Looper.loop(

 ERROR/AndroidRuntime(500):     at

 ERROR/AndroidRuntime(500):     at
java.lang.reflect.Method.invokeNative(Native Method)

 ERROR/AndroidRuntime(500):     at

 ERROR/AndroidRuntime(500):     at

 ERROR/AndroidRuntime(500):     at

 ERROR/AndroidRuntime(500):     at
dalvik.system.NativeStart.main(Native Method)

 WARN/ActivityManager(60):   Force finishing activity

I think the problem is with the context of the webview but not able to
figure out how to set the context for the existing object or pass
context to dialog generated inside the webview.

Thanks in advance.


2. lcd 18bpp problem


My board is supporting only 18bpp format,but android is supporting
only RGB565(16bpp) format.So have somebody have faced the same issue
and help me out for it?




3. How to input the multiple keyboard inputs

4. Strange thing, using HorizontalScrollView

5. Android education program

6. code to invoke Android Music Player Application

7. UAC based on sip and SipDemo App not working