INNER CODE UNIT · Kotlin

onDataChange

shmykelsa/AAAD · app/src/main/java/com/legs/appsforaa/AboutPaymentActivity.kt:115

            override fun onDataChange(snapshot: DataSnapshot) {
                if (snapshot.exists() && snapshot.getValue(Boolean::class.java) == true) {
                    // User is already pro
                    showProStatus()
                }
            }

            override fun onCancelled(error: DatabaseError) {
                Toast.makeText(this@AboutPaymentActivity, 
                    getString(R.string.connection_error), Toast.LENGTH_SHORT).show()
            }
        })
    }

    private fun showProStatus() {
        val upperTextView = findViewById<TextView>(R.id.upper_textview)
        val centralTextView = findViewById<TextView>(R.id.central_textview)
        val proButton = findViewById<View>(R.id.proButton)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…