Android Question Object should first be initialized

Electrocutioner

Member
Licensed User
Longtime User
even though I load the layout, I get "Object should first be initialized" error when it loads.

layout was created with Designer.

_______________________________________________________________________
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")

'Set the previous stored state

Activity.LoadLayout("6")
StateManager.RestoreState(Activity, "addresses", 60)
_______________________________________________________________________
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
I think your load layout here shows as comment.

'Activity.LoadLayout("Layout1")

should be. (remove the quotation mark before Activity)

B4X:
Activity.LoadLayout("Layout1")
That is just the usual example, the actual LoadLayout is done a couple of lines below where he loads layout "6".
I suspect that the problem will be with StateManager.RestoreState but I've never used this and so not in a position to offer reliable advice.
 
Upvote 0
Top