Android Question Standard Class and Loading a layout into a panel

Addo

Well-Known Member
Licensed User
Longtime User
Hey everyone, This question may sounds odd but I am stuck with it .
I have created a standard class and declare a panel into it and loading a layout into the panel that I declared after initializing it.
when I create the class from Activity everything is working fine .
but if I create the class from a service I get NullPointerException.


does that means that I cannot load layout to a panel in standard class if my code is running in a service ?

the creation of panel code looks like following

B4X:
Public Sub loadPanellayout(awidth As Int, aheight As Int)
    usrpnl.Initialize("usrpnl")
    usrpnl.SetLayout(0, 0, awidth, aheight)
    usrpnl.LoadLayout("userpanelitem")
    Log(udisplay)
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…