title: Why can't I initialise my ArrayAdapter in Kotlin?
body: <p>I want to initialise an <code>ArrayAdapter</code> using an array of strings in <code>counties</code> but I get an error message when I run my app. Here is my code:</p>
  
  <pre><code>class EnglandFragment : Fragment() {
  
      // Access a Cloud Firestore instance from your Activity
      val db = FirebaseFirestore.getInstance()
      lateinit var adapter : ArrayAdapter&lt;String&gt;
  
      override fun onCreateView(
          inflater: LayoutInflater,
          container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View? {
          val root = inflater.inflate(R.layout.fragment_england, container, false)
  
          var mContext: Context? = null
          mContext = getActivity() as CountriesActivity
          mContext.initializeCustomActionBar(R.drawable.england_flag, R.string.title_counties)
          var counties : Array&lt;String&gt;
  
          val docRef = db.collection("UKSites").document("England")
          docRef.get()
              .addOnSuccessListener { document -&gt;
                  if (document != null) {
                      counties = document.get("Counties") as Array&lt;String&gt;
  
                      adapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, counties)
  
  
                  } else {
                      Log.d("Debug", "No such document")
                  }
              }
              .addOnFailureListener { exception -&gt;
                  Log.d("Debug", "get failed with ", exception)
              }
  
          return root
      }
  
  }
  </code></pre>
  
  <p>I get the following error message:</p>
  
  <pre><code>None of the following functions can be called with the arguments supplied:
  public constructor ArrayAdapter&lt;T : Any!&gt;(@NonNull p0: Context, p1: Int, @NonNull p2: Array&lt;(out) String!&gt;) defined in android.widget.ArrayAdapter
  public constructor ArrayAdapter&lt;T : Any!&gt;(@NonNull p0: Context, p1: Int, p2: Int) defined in android.widget.ArrayAdapter
  public constructor ArrayAdapter&lt;T : Any!&gt;(@NonNull p0: Context, p1: Int, @NonNull p2: (Mutable)List&lt;String!&gt;) defined in android.widget.ArrayAdapter
  </code></pre>