title: Kotlin showed type mismatch in fragment
body: <p>I have a fragment with RecyclerAdapter inside it. I want to initialize the adapter in the <code>onCreateView</code> method but it throws the error of <code>"Type mismatch. Required : Context , Found : FragmentActivity"</code> in this statement</p>
  
  <p>I have no idea why the first one showed this error and the second one did not contains compile time error.</p>
  
  <p>Error shown</p>
  
  <pre><code>recyclerView!!.adapter = RestaurantMenuAdapter(activity)
  </code></pre>
  
  <p>No Error shown</p>
  
  <pre><code>recyclerView!!.layoutManager = LinearLayoutManager(activity)
  </code></pre>
  
  <p>Fragment.kt</p>
  
  <pre><code>override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                            savedInstanceState: Bundle?): View? {
      // Inflate the layout for this fragment
      val view = inflater.inflate(R.layout.fragment_restaurant_menu, container, false)
      recyclerView = view.findViewById(R.id.restaurant_container)
      recyclerView!!.adapter = RestaurantMenuAdapter(activity)
      recyclerView!!.layoutManager = LinearLayoutManager(activity)
  </code></pre>
  
  <p>RecyclerAdapter.kt</p>
  
  <pre><code>class RestaurantMenuAdapter  (val context : Context) : RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt;() {
      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
          val inflater = parent.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
          return object : RecyclerView.ViewHolder(inflater.inflate(R.layout.item_menu1, parent, false)) {
  
          }
      }
  
      override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
  
      }
  
      override fun getItemCount(): Int {
          return 10
      }
  }
  </code></pre>