title: How to change the text of a progress bar
body: <p>//  Guys, I'm a beginner android developer and I am trying to change the dialogue text from &quot;Please Wait&quot; to other string text, below is my XML caption</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:layout_gravity=&quot;center&quot;
      android:orientation=&quot;horizontal&quot;
      android:padding=&quot;23dp&quot;&gt;
  
  
      &lt;ProgressBar
          android:id=&quot;@+id/progressBar&quot;
          android:layout_width=&quot;64dp&quot;
          android:layout_height=&quot;64dp&quot;
          app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
          app:layout_constraintEnd_toStartOf=&quot;@+id/tvProgressBar&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  
      &lt;com.hardextech.caramel.utils.MyCustomFont
          android:id=&quot;@+id/tvProgressBar&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:text=&quot;Please Wait......&quot;
          android:textColor=&quot;@color/black&quot;
          android:textSize=&quot;20sp&quot;
          app:layout_constraintBottom_toBottomOf=&quot;@+id/progressBar&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintStart_toEndOf=&quot;@+id/progressBar&quot;
          app:layout_constraintTop_toTopOf=&quot;@+id/progressBar&quot; /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  <p>// Below is my code in Kotlin</p>
  <pre><code>package com.hardextech.caramel.activities
  
  import android.app.Dialog
  import android.widget.ProgressBar
  import androidx.appcompat.app.AppCompatActivity
  import androidx.core.content.ContextCompat
  import com.google.android.material.snackbar.Snackbar
  import com.hardextech.caramel.R
  
  
  
  open class BaseActivity : AppCompatActivity() {
  
      private lateinit var progressBar: Dialog
  
  // Method to show the progressBar
          fun showProgressDialogue(text:String){
          progressBar = Dialog(this)
          progressBar.setContentView(R.layout.progress_dialogue)
          progressBar.tvProgressBar.text = text
          progressBar.setCancelable(false)
          progressBar.setCanceledOnTouchOutside(false)
          progressBar.show()
  
      }
  
      fun dismissProgressDialogue(){
          progressBar.dismiss()
  
      }
  }
  </code></pre>
  <p>//  I expect the line of code progressBar.tvProgressBar.text = text to change dialogue text to the constructor text: String but not implementing. I don't know how to go about it.</p>