Android Question Custom View Initialize2 , a No No ?

Discussion in 'Android Questions' started by Cableguy, May 30, 2015.

  1. Cableguy

    Cableguy Expert Licensed User

    I have been trying all day to implement an "initialize2" method into one of my custom Views, but it errors with a bizarre java.lang.NullPointerException: null receiver.

    If I change The sub declaration to "Initialize", without changing anything else in the code, it all works as expected...

    Is it right to assume that such declaration is forbidden?
  2. Erel

    Erel Administrator Staff Member Licensed User

    The Initialize method and only this method is considered a special method that should be first called when initializing classes. An Initialize2 sub will be treated like any other regular sub.
    Cableguy likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice