همچنان ارور میده و برنامه بسته میشه
ارور:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
main_button1_click (java line: 368)
android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@3da9f19 -- permission denied for this window type
at android.view.ViewRootImpl.setView(ViewRootImpl.java:591)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:310)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
at com.toast.libs.AchievementUnlocked.buildAchievement(AchievementUnlocked.java:477)
at com.toast.libs.AchievementUnlocked.build(AchievementUnlocked.java:304)
at com.toast.core.AriaToast.Build(AriaToast.java:78)
at b4a.example.testt.main._button1_click(main.java:368)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5204)
at android.view.View$PerformClick.run(View.java:21153)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5420)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
کد:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Dim toast As AriaToast
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
toast.requestDrawPermission
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
toast.Initialize("toast").SubTitle("B4A").Title("test").Icon(LoadBitmap(File.DirAssets,"caution1.png")).Build.Show
End Sub