title: ListView Array Adapter error"None of the following functions can be called with the arguments supplied."
body: <p>I'm trying to create a fragment with a ListView with the id=lv and the ArrayAdapter doesn't seem to work</p>
  <p>this is the fragment code</p>
  <pre><code>class Istoric : Fragment() {
      var array = arrayOf(&quot;item1&quot;,&quot;item2&quot;)
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          val adapter = ArrayAdapter(this,R.layout.listview_item,array)
      }
  
      override fun onCreateView(
          inflater: LayoutInflater, container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View? {
          // Inflate the layout for this fragment
          return inflater.inflate(R.layout.fragment_istoric, container, false)
      }
  
      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
          super.onViewCreated(view, savedInstanceState)
  
          val lv1: ListView = view.findViewById(R.id.lv)
          lv1.setAdapter(adapter)
      }
  } 
  </code></pre>
  <p><a href="https://i.stack.imgur.com/QunQq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QunQq.png" alt="enter image description here" /></a></p>