title: Kotlin lazy properties and values reset: a resettable lazy delegate
body: <p>So I use <code>kotlin</code> for android, and when inflating views, I tend to do the following:</p>
  
  <pre><code>private val recyclerView by lazy { find&lt;RecyclerView&gt;(R.id.recyclerView) }
  </code></pre>
  
  <p>This method will work. However, there is a case in which it will bug the app. If this is a fragment, and the fragment goes to the backstack, <code>onCreateView</code> will be called again, and the view hierarchy of the fragment will recreated. Which means, the lazy initiated recyclerView will point out to an old view no longer existent. </p>
  
  <p>A solution is like this:</p>
  
  <pre><code>private lateinit var recyclerView: RecyclerView
  </code></pre>
  
  <p>And initialise all the properties inside <code>onCreateView</code>.</p>
  
  <p>My question is, is there any way to reset lazy properties so they can be initialised again? I like the fact initialisations are all done at the top of a class, helps to keep the code organised. The specific problem is found in this question: <a href="https://stackoverflow.com/questions/35744969/kotlin-android-fragment-empty-recycler-view-after-back">kotlin android fragment empty recycler view after back</a></p>