Admob on Android - Status bar area not covered when activity is resumed -


i'm experiencing nasty bug trying implement admob in application. thought problem in code, after investigation found present in android-banner-essentials example (available download here). wonder if ever met problem or maybe knows how deal it.

basically, when application has both status , title bar disabled, should use full screen. banner essentials example displays nothing admob banner on top of area available. downloaded example, changed 2 things:

  • added publisher id compile , receive ads ;)
  • added 1 param activity's manifest disable title , status bar: android:theme="@android:style/theme.notitlebar.fullscreen"

compiled binary, no matter device launched on (tried nexus one, g1, desire, different android versions), affected same issue:

  • when ad banner displayed press home,
  • once taken home screen press , hold home see launched apps,
  • select banner essentials app.

my tests reveal 50% reproduction chance admob banner doesn't go position -the top of screen. show better mean prepared 3 screenshots:

http://img841.imageshack.us/g/correctz.png/

important notices:

  • when app resumed normally, banner displayed below status bar, , slides until aligned top screen border,
  • when error appears banner doesn't move @ all,
  • i couldn't reproduce issue other interrupt (pressing back, power button),
  • i think may somehow connected gaining/losing focus (see screenshots).

my app bit more complex banner essentials started searching issue in code, no luck, tried simplify situation as possible , here results.

does know may causing problem? maybe additional flags or properties have set handle behaviour?

this 1 referenced android bug. there no solution, workaround. have re-set window fullscreen 1 second after onresume (to wait till status bar finishes fancy sliding out animation...), cause re/calculate whole layout, "solving" problem (with quick jump correct positiin).

public void onresume() {    ...      handler.postdelayed(new runnable() {         public void run() {             getwindow().setflags(windowmanager.layoutparams.flag_fullscreen,                              windowmanager.layoutparams.flag_fullscreen);         }     }, 1500);     ...  } 

it's not good. it's still best available. more info here.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -