findViewById in Fragment
In Fragment sub class in Android, you cannot directly use findViewById() to retrieve the control from view , similar with Activity. You need to do a single small step, this.getView(); Note that, to use this method, the view need to created, such as in onOptionsItemSelected
If you wish to use it in OnCreateView, please do that in this way. At that moment, the view is not created yet, this.getView() will return null.
Trackback address for this post
Feedback awaiting moderation
This post has 1 feedback awaiting moderation...
Form is loading...