title: How to save the state of delayed posts in Kotlin
body: <p>For an Android app I have some content that I want to show with a delay. Therefore I'm using a handler. </p>
  
  <pre><code>private lateinit var mHandler: Handler
  
  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      setContentView(R.layout.activity_main)
  
      linearLayout.isVisible = false
  
      mHandler = Handler()
      mHandler.postDelayed({
          linearLayout.isVisible = true 
      }, 1000)
  }
  </code></pre>
  
  <p>How can I save this state (for example in case of rotating the app)? And is it better to use <code>SharedPreferences</code> or something like this:</p>
  
  <pre><code>override fun onSaveInstanceState(outState: Bundle?) {
      super.onSaveInstanceState(outState)
  
  }
  
  override fun onRestoreInstanceState(savedInstanceState: Bundle?) {
      super.onRestoreInstanceState(savedInstanceState)
  
  }
  </code></pre>