I do call findViewById() right after setContentView() and I get the object. But I was thinking that if I call mToggleButton.setChecked(true) after setContentView() it might show flickering. Anyways thought I can give a quick try before getting into deep and I did not notice flickering in emulator and hopefully on real device it shouldn't be a problem. Thanks lb
On Sep 1, 11:25 pm, TreKing <treking...@gmail.com> wrote: > On Thu, Sep 1, 2011 at 8:57 PM, lb <lakshman.b...@gmail.com> wrote: > > But I got stumble with the findViewById(R.id.togglebutton). This returns > > null if I call before setContentView(R.layout.main). > > Did you try calling it after ... ? > > ------------------------------------------------------------------------------------------------- > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > transit tracking app for Android-powered devices -- 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...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en