title: Kotlin Android Fragment recyclerView and context issue
body: <p>I would like to create an recyclerView in a fragment, but it shows an error "    java.lang.IllegalStateException: recylerView_Main must not be null
          at com.gph.bottomnavigation.FragmentMe.onCreateView(FragmentMe.kt:28)"</p>
  
  <ul>
  <li>Question 1) Please kindly help to solve this issue. </li>
  <li>Question 2) I created an recyclerView only in a empty project without any fragment, it is working properly. </li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/dFInx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dFInx.png" alt="enter image description here"></a></p>
  
  <p>But the same code is no working in Fragment, it shows error so I change "recylerView_Main.layoutManager = LinearLayoutManager(this)" to "recylerView_Main.layoutManager = LinearLayoutManager(context)"
   It shows no error and I can run in simlulator, but when I click the navigation button of the Fragment, the app stops and show this error. Please kindly help to solve it.
  <a href="https://i.stack.imgur.com/cQg0Q.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cQg0Q.png" alt="enter image description here"></a></p>
  
  <p>Here with the code for FragmentMe.kt:</p>
  
  <pre><code>class FragmentMe : Fragment() {
  
          override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
  
  
                 savedInstanceState: Bundle?): View? {
  
          recylerView_Main.layoutManager = LinearLayoutManager(context)
          recylerView_Main.adapter = Mainadapter()
  
          // Inflate the layout for this fragment
          return inflater.inflate(R.layout.fragment_me, container, false)
      }
  
  }
  </code></pre>
  
  <p>Here with the code of MainActivity.kt:</p>
  
  <pre><code>class MainActivity : AppCompatActivity() {
  
      val manager = supportFragmentManager
  
      private val mOnNavigationItemSelectedListener = BottomNavigationView.OnNavigationItemSelectedListener { item -&gt;
          when (item.itemId) {
              R.id.navigation_home -&gt; {
                  //message.setText(R.string.title_home)
                  createFragmentQpon()
                  return@OnNavigationItemSelectedListener true
              }
              R.id.navigation_dashboard -&gt; {
                  //message.setText(R.string.title_dashboard)
                  createFragmentMe()
                  return@OnNavigationItemSelectedListener true
              }
              R.id.navigation_notifications -&gt; {
                  //message.setText(R.string.title_notifications)
                  createFragmentTools()
                  return@OnNavigationItemSelectedListener true
              }
  
          }
          false
      }
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
  
          //Action Bar
          val actionBar = supportActionBar
          actionBar!!.setDisplayShowHomeEnabled(true)
          actionBar.setBackgroundDrawable(ColorDrawable(Color.parseColor("#00FFFFFF")))
          actionBar.setIcon(R.drawable.ic_home_black_24dp)
          actionBar.setDisplayShowTitleEnabled(false)
  
          createFragmentQpon()
          navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener)
      }
  
      fun createFragmentQpon() {
          val transaction = manager.beginTransaction()
          val fragment = FragmentQpon()
          transaction.replace(R.id.fragmentholder,fragment)
          transaction.addToBackStack(null)
          transaction.commit()
      }
  
      fun createFragmentMe() {
          val transaction = manager.beginTransaction()
          val fragment = FragmentMe()
          transaction.replace(R.id.fragmentholder,fragment)
          transaction.addToBackStack(null)
          transaction.commit()
      }
  
      fun createFragmentTools() {
          val transaction = manager.beginTransaction()
          val fragment = FragmentTools()
          transaction.replace(R.id.fragmentholder,fragment)
          transaction.addToBackStack(null)
          transaction.commit()
      }
  
  
  
  }
  </code></pre>
  
  <p>Here with the code of Mainadapter.kt:</p>
  
  <pre><code>class Mainadapter: RecyclerView.Adapter&lt;CustomViewHolder&gt;() {
  
      val videolist = listOf("aaa","bbbb","cccc")
  
      override fun getItemCount(): Int {
          return  3
      }
  
      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CustomViewHolder {
  
          val layoutInflater = LayoutInflater.from(parent?.context)
          val cellForRow = layoutInflater.inflate(R.layout.tutorial_layout, parent, false)
          return CustomViewHolder(cellForRow)
  
      }
  
      override fun onBindViewHolder(holder: CustomViewHolder, position: Int) {
  
          var videoName = videolist.get(position)
  
  
          holder.itemView.title.text = videoName
  
      }
  
  
  }
  
  class CustomViewHolder(v: View): RecyclerView.ViewHolder(v) {
  }
  </code></pre>