I\'m having a trouble with findViewByid
but I can\'t find where the problem is.
Here\'s my FirstFragment
class code:
import and
Fragment
doesn't provide thefindViewById()
method. This is provided in Activity
or View
. When implementing a Fragment
you don't inflate your views in onCreate()
(like you normally do in an Activity
.) Instead, you do it in onCreateView()
and you need to use the inflated root View
to find the ID within the layout you inflated.