title: How to play intro, that it's only played when app is installed, when a button is clicked?
body: <p>Before the user uses the app there is an intro that explains how the app is used. However I want to add a button to the homepage that ables the user to see the intro again. How should I do that?
  I already tried to call the class Intro in the class Homepage but nothing happens
  Here is the code of my Intro: </p>
  
  <pre><code>    class Intro : AppCompatActivity() {
  
  private val introSliderAdapter = IntroSliderAdapter(
      listOf(
          IntroSlide("Capture a ignição",
              "Tire uma fotografia á ignição que avista. Por favor mantanha o telemóvel na vertical",
              R.drawable.image1),
          IntroSlide("Localização",
              "É necessário que tenha o GPS ligado do seu telémovel. Ao capturar a fotografia serão automáticamente gravados a sua localização e o ângulo a que o fogo se encontra",
              R.drawable.image2),
          IntroSlide("Envio para os operacionais ",
              "Após os passos anteriores devidamente cumpridos, a informação fornecida será  avaliada por operacionais responsáveis.",
              R.drawable.image3)
      )
  )
  
  private var PRIVATE_MODE = 0
  private val PREF_NAME = "mindorks-welcome"
  
  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      //setContentView(R.layout.activity_main)
      val sharedPref: SharedPreferences = getSharedPreferences(PREF_NAME, PRIVATE_MODE)
      if (sharedPref.getBoolean(PREF_NAME, false)) {
          val homeIntent = Intent(this, HomePage::class.java)
          startActivity(homeIntent)
          finish()
      } else {
          setContentView(R.layout.activity_intro)
          playIntro()
          val editor = sharedPref.edit()
          editor.putBoolean(PREF_NAME, true)
          editor.apply()
      }
  }
  
  fun playIntro()
  {
      introSliderViewPager.adapter=introSliderAdapter
      setupIndicators()
      setCurrentIndicator(0)
      introSliderViewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback(){
          override fun onPageSelected(position: Int) {
              setCurrentIndicator(position)
  
          }
      })
  
  
      buttonNext.setOnClickListener {
          if(introSliderViewPager.currentItem+1 &lt; introSliderAdapter.itemCount){
              introSliderViewPager.currentItem+=1
          }else{
  
              Intent(applicationContext, HomePage::class.java).also {
                  startActivity(it)
                  finish()
              }
  
          }
  
      }
      buttonSkip.setOnClickListener {
          Intent(applicationContext, HomePage::class.java).also {
              startActivity(it)
              finish()
          }
      }
  
  }
  private fun setupIndicators(){
      val indicators = arrayOfNulls&lt;ImageView&gt;(introSliderAdapter.itemCount)
      val layoutParams : LinearLayout.LayoutParams = LinearLayout.LayoutParams(
          ViewGroup.LayoutParams.WRAP_CONTENT,
          ViewGroup.LayoutParams.WRAP_CONTENT
      )
      layoutParams.setMargins(8,0,8,0)
      for (i in indicators.indices){
          indicators[i]  = ImageView(applicationContext)
          indicators[i].apply {
              this?.setImageDrawable(
                  ContextCompat.getDrawable(
                      applicationContext,
                      R.drawable.indicator_inactive
                  )
              )
              this?.layoutParams = layoutParams
          }
          indicatorsContainer.addView(indicators[i])
      }
  }
  private fun setCurrentIndicator(index:Int ){
      val childCount = indicatorsContainer.childCount
      for(i in 0 until childCount){
          val imageView = indicatorsContainer[i] as ImageView
          if(i==index){
              imageView.setImageDrawable(
                  ContextCompat.getDrawable(
                      applicationContext,
                      R.drawable.indicator_active
                  )
              )
              buttonNext.text ="PRÓXIMO"
          }else{
              imageView.setImageDrawable(
                  ContextCompat.getDrawable(
                      applicationContext,
                      R.drawable.indicator_inactive
                  )
              )
              buttonNext.text ="PRÓXIMO"
  
  
          }
  
      }
      if(index == introSliderAdapter.itemCount -1)
      {
          buttonNext.text ="FIM"
      }
  }
   }
  </code></pre>