sendPasswordResetEmail in firebase using android studio and kotlin - Joklinz-Tech

Latest

Home Of Tech news,jobs and android tutorials

Thursday, 8 February 2018

sendPasswordResetEmail in firebase using android studio and kotlin



class Main2Activity : AppCompatActivity() {
    private var mauth = FirebaseAuth.getInstance()
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main2)
        requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT          val email = findViewById<View>(R.id.editText5) as EditText
        val txt=findViewById<View>(R.id.textView12) as TextView
         val btn = findViewById<View>(R.id.btn) as Button

        btn.setOnClickListener {            toast("processing..........")
           mauth.sendPasswordResetEmail(email.text.toString().trim())
                   .addOnCompleteListener{ task->                       if (task.isSuccessful){
                           toast("Password sent successfully,check your mail")
                       }
                       else{
                           toast("User not registered on our platform")
                       }
                   }        }




No comments:

Post a Comment