Hello everyone, i'm working on a live wallpaper app, i would like to add leadbolt notifications on the app, i need some help figuring this out, when i declare the variable on the sub Process globals i get an error saying that the leadbolt variable can not be declared there, i then move it to a sub and use like this
but when the sub gets called i get this error,
thanks,
Walter
B4X:
Sub notify2
Dim notify1 As LeadboltWrapper
notify1.Initialize("notify1")
notify1.AsynchTask = True
notify1.setListener
notify1.loadLeadboltAds("499693552", notify1.ADS_NOTIFICATION)
Log("sub notify2 called")
End Sub
but when the sub gets called i get this error,
can anybody please help me figure this out, i know it may probably be something simple, but my brain is half asleep right now , any help will be appreciated.LogCat connected to: TA28705IOE
--------- beginning of /dev/log/main
** Activity (main) Create, isFirst = true **
sub notify called
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
wallpaperservice_notifytimer_tick (B4A line: 127)
notify1.loadLeadboltAds("499693552", notify1.ADS_NOTIFICATION)
java.lang.IllegalStateException: View com.android.internal.policy.impl.PhoneWindow$DecorView@40540bb8 has already been added to the window manager.
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:125)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
at android.view.Window$LocalWindowManager.addView(Window.java:424)
at android.app.Dialog.show(Dialog.java:241)
at anywheresoftware.b4a.debug.Debug.wait(Debug.java:202)
at anywheresoftware.b4a.debug.Debug.reachBP(Debug.java:252)
at anywheresoftware.b4a.debug.Debug.ErrorCaught(Debug.java:141)
at com.dandre.dev.livewallpaper.wallpaperservice._notifytimer_tick(wallpaperservice.java:262)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:136)
at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:103)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3806)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: java.lang.IllegalStateException: View com.android.internal.policy.impl.PhoneWindow$DecorView@40540bb8 has already been added to the window manager.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:165)
at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:103)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3806)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: View com.android.internal.policy.impl.PhoneWindow$DecorView@40540bb8 has already been added to the window manager.
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:125)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
at android.view.Window$LocalWindowManager.addView(Window.java:424)
at android.app.Dialog.show(Dialog.java:241)
at anywheresoftware.b4a.debug.Debug.wait(Debug.java:202)
at anywheresoftware.b4a.debug.Debug.reachBP(Debug.java:252)
at anywheresoftware.b4a.debug.Debug.ErrorCaught(Debug.java:141)
at com.dandre.dev.livewallpaper.wallpaperservice._notifytimer_tick(wallpaperservice.java:262)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:136)
... 10 more
thanks,
Walter