title: Getting Unresolved Reference from Singleton Class
body: <p>I am working with android studio and in Kotlin. I am working with a Singleton class so my confusion is that my getInstance function is not being called when I am trying to add that into my setupRecyclerView function and it keeps saying it is an unresolved reference. I also have the issue that my <code>NewsListActivity.SimpleItemRecyclerViewAdapter</code> also keeps getting an unresolved reference when I try to reference it. Any help would be greatly appreciated.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>package edu.uw.amjadz.material_news
  
  import android.content.Context
  import android.graphics.Bitmap
  import android.util.LruCache
  import com.android.volley.Request
  import com.android.volley.RequestQueue
  import com.android.volley.toolbox.ImageLoader
  import com.android.volley.toolbox.Volley
  
  class Singleton private constructor(context: Context){
  
      private var INSTANCE: edu.uw.amjadz.material_news.Singleton? = null
      
      fun getInstance(context: Context): edu.uw.amjadz.material_news.Singleton {
          if(INSTANCE == null){
              INSTANCE = Singleton(context)
          }
          return INSTANCE as edu.uw.amjadz.material_news.Singleton
      }
  
      val requestQueue: RequestQueue by lazy {
          Volley.newRequestQueue(context.applicationContext)
      }
  
      val imageLoader: ImageLoader by lazy {
          ImageLoader(requestQueue,
              object : ImageLoader.ImageCache{
                  private  val cache = LruCache&lt;String, Bitmap&gt;(20)
                  override fun getBitmap(url: String?): Bitmap {
                      return  cache.get(url)
                  }
  
                  override fun putBitmap(url: String?, bitmap: Bitmap?) {
                      cache.put(url, bitmap)
                  }
              }
          )
  
      }
  
      fun &lt;T&gt; add(req: Request&lt;T&gt;){
          requestQueue.add(req)
      }
  
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code> private fun setupRecyclerView(recyclerView: RecyclerView) {
          recyclerView.setAdapter(null)
          val key = getString(R.string.NEWS_API_KEY)
          val url = "https://newsapi.org/v2/everything?q=bitcoin&amp;from=2018-10-01&amp;sortBy=publishedAt&amp;apiKey=$key"
  
          val jsonObjectRequest = JsonObjectRequest(
              Request.Method.GET, url, null,
              Response.Listener { response -&gt;
                  recyclerView.adapter = NewsListActivity.SimpleItemRecyclerViewAdapter(this, DummyContent.parseData(response.toString()), twoPane)
  
              },
              Response.ErrorListener { error -&gt;
  
              }
          )
          Singleton.getInstance(this).add(jsonObjectRequest)
          if (twoPane){
              recyclerView.layoutManager = LinearLayoutManager(this)
  
          } else {
              recyclerView.layoutManager = GridLayoutManager(this, 2)
  
          }
      }
  }
  
      class SimpleItemRecyclerViewAdapter(
          private val parentActivity: NewsListActivity,
          private val values: List&lt;DummyContent.DummyItem&gt;,
          private val twoPane: Boolean
      ) :
          RecyclerView.Adapter&lt;SimpleItemRecyclerViewAdapter.ViewHolder&gt;() {
  
          private val onClickListener: View.OnClickListener
  
          init {
              onClickListener = View.OnClickListener { v -&gt;
                  val item = v.tag as DummyContent.DummyItem
                  if (twoPane) {
                      val fragment = NewsDetailFragment().apply {
                          arguments = Bundle().apply {
                              putString(NewsDetailFragment.ARG_ITEM_ID, item.id)
                          }
                      }
                      parentActivity.supportFragmentManager
                          .beginTransaction()
                          .replace(R.id.news_detail_container, fragment)
                          .commit()
                  } else {
                      val intent = Intent(v.context, NewsDetailActivity::class.java).apply {
                          putExtra(NewsDetailFragment.ARG_ITEM_ID, item.id)
                      }
                      v.context.startActivity(intent)
                  }
              }
          }</code></pre>
  </div>
  </div>
  </p>