Android Question Object should first be initialized

Discussion in 'Android Questions' started by Electrocutioner, Jun 21, 2015.

  1. Electrocutioner

    Electrocutioner Member Licensed 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)
    _______________________________________________________________________
     
  2. giga

    giga Well-Known Member Licensed User

    I think your load layout here shows as comment.

    'Activity.LoadLayout("Layout1")

    should be. (remove the quotation mark before Activity)

    Code:
    Activity.LoadLayout("Layout1")
     
    Last edited: Jun 21, 2015
  3. RandomCoder

    RandomCoder Well-Known Member Licensed User

    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.
     
  4. giga

    giga Well-Known Member Licensed User

    RandomCoder likes this.
Loading...