title: Store int using Firebase Realtime Database
body: <p>I've connected my app to Firebase Realtime database and have set up a data class but haven't found a way to save an int to the database. I would like to store the number of times a user presses a certain button. I have seen a few yt tutorials but haven't gotten past this step since I couldn't find one that's specifically for Int and not String.</p>
  <p>Data Class:
  <code>data class Total(val amount: Int? = null)</code></p>
  <p>Activity:</p>
  <pre><code>class SecondActivity : AppCompatActivity() {
  
      private lateinit var Total: Total
      private lateinit var amount : Total
      var database : DatabaseReference = FirebaseDatabase.getInstance().getReference(&quot;Total&quot;)
  
  override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_second)
  
  var incrementNumber = 0
  button_increment.setOnClickListener {
  
       database.child(&quot;value&quot;).setValue(incrementNumber);
       &quot;Button has been pressed $incrementNumber times!&quot;.also {increment_textview.text = it }
  
          }
      }
  }
  </code></pre>