Hi guys,
Device: Samsung Galaxy S4
After i added a Adview to my project like this:
public class GameActivity
extends NativeActivity
{ private static final String advStart
= "xxxxxxxxxxxxxxxxxxxxxx"; AdView startAD
; PopupWindow popUp
; GameActivity _activity
; LinearLayout layout
; LinearLayout mainLayout
; boolean adsinited
= false; public void onCreate
(Bundle savedInstanceState
) { super.
onCreate(savedInstanceState
); getWindow
().
addFlags(WindowManager.
LayoutParams.
FLAG_KEEP_SCREEN_ON); _activity
= this; startAD
= new AdView
(this); startAD.
setAdSize(AdSize.
SMART_BANNER); startAD.
setAdUnitId(advStart
); startAD.
setVisibility(View.
VISIBLE); startAD.
refreshDrawableState(); } public void showAdPopup
() { if (adsinited
) { return; } if (startAD
!= null) { _activity.
runOnUiThread(new Runnable() { @Override
public void run
() { adsinited
= true; popUp
= new PopupWindow
(_activity
); popUp.
setHeight(50); popUp.
setWindowLayoutMode(LayoutParams.
WRAP_CONTENT,
LayoutParams.
WRAP_CONTENT); popUp.
setClippingEnabled(false); layout
= new LinearLayout
(_activity
); mainLayout
= new LinearLayout
(_activity
); layout.
setPadding(-5,
-5,
-5,
-5); MarginLayoutParams params
= new MarginLayoutParams
( LayoutParams.
WRAP_CONTENT,
LayoutParams.
WRAP_CONTENT); params.
setMargins(0,
0,
0,
0);layout.
setOrientation(LinearLayout.
VERTICAL);if(startAD.
getParent() != null)((ViewGroup
)startAD.
getParent()).
removeView(startAD
); layout.
addView(startAD, params
); popUp.
setContentView(layout
); _activity.
setContentView(mainLayout, params
); AdRequest.
Builder aB
= new Builder
(); aB.
addTestDevice("B6F0C02A66C0C639398CDD1C6DEA026E"); _activity.
startAD.
loadAd(aB.
build()); new Handler
().
postDelayed(new Runnable() { public void run
() { popUp.
showAtLocation(mainLayout, Gravity.
TOP,
0,
0); } },
100); popUp.
update(); } }); } } @Override
public void onDestroy
() { if (startAD
!= null) { startAD.
destroy(); } super.
onDestroy(); }
sometimes I get a error or a warning like this:
08-15 22:50:37.441: W/Adreno-EGLSUB(12948): <DequeueBuffer:736>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
08-15 22:50:37.441: W/Adreno-EGLSUB(12948): <DequeueBuffer:736>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
08-15 22:50:37.441: W/Adreno-EGL(12948): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
08-15 22:50:37.441: W/Adreno-EGLSUB(12948): <DequeueBuffer:736>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
08-15 22:50:37.441: W/Adreno-EGL(12948): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
08-15 22:50:37.451: W/Adreno-GSL(12948): <sharedmem_gpumem_alloc_id:1498>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory
08-15 22:50:37.451: E/Adreno-GSL(12948): <gsl_memory_alloc_pure:2044>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.
08 - 16 17:10 : 23.984 : W / Adreno - EGL(22021) : <qeglDrvAPI_eglSwapBuffers : 3702> : EGL_BAD_SURFACE
08 - 16 17 : 10 : 23.984 : E / BufferQueueProducer(281) : [packageName / packageName.GameActivity] dequeueBuffer : BufferQueue has been abandoned
08 - 16 17 : 10 : 23.984 : W / Adreno - EGLSUB(22021) : <DequeueBuffer : 736> : dequeue native buffer fail : No such device, buffer = 0x0, handle = 0x0
08 - 16 17 : 10 : 23.984 : W / Adreno - EGL(22021) : <qeglDrvAPI_eglSwapBuffers : 3702> : EGL_BAD_SURFACE
Please can anyone help me with this Problem or can tell me a solution ?
darrit