Android Question AHPopupmenu problem

grafsoft

Well-Known Member
Licensed User
Longtime User
Hi,

when I try to initialize an AHPopupMenu, I get an error:

Error occurred on line: 102 (draw)
android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1123)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2312)
at android.content.res.Resources.getLayout(Resources.java:939)
at android.view.LayoutInflater.inflate(LayoutInflater.java:395)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at de.amberhome.quickaction.ICSMenu.setRootViewId(ICSMenu.java:108)
at de.amberhome.quickaction.ICSMenu.Initialize(ICSMenu.java:67)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:680)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:308)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at FB.Tag.draw.afterFirstLayout(draw.java:98)
at FB.Tag.draw.access$100(draw.java:16)
at FB.Tag.draw$WaitForLayout.run(draw.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5102)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)


B4X:
Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim men As AHPopupMenu
   ...
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("touch")
   ...   

   men.Initialize("AC") ' crashes here
end sub

But this works perfecty in another app, I simply copied the *.bas and *.bal of the activity.

Any hints? Thank you.
 
Top