In java object does not exist until constructor call is complete -
so no other methods can be called on it. However, it can be that
different constructor was called (default one?)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to
Thaks all for your helpful tips.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googleg
The simple solution, that followed by all (at least, all of it that I
have seen) Google's sample and tutorial code is: don't use the
constructor. Do all your initialization instead in onCreate().
If you do this, the problem you are having goes away. You should
almost certainly be using a (built-in
You might not want to do what you want directly in the activity. You
might want to create a different class and put the necessary calls in
that. Then you can instantiate an instance in the oncreate method.
Typically oncreate is a good place to initialize GUI components and
callbacks.
Cheers.
On
4 matches
Mail list logo