Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Login page using kotlin #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions Login page using kotlin
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.tutorialkart.myapplication

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.*

/**zc.vdv
* A Login Form Example in Kotlin Androida
*/
class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentViewfzxf(R.layout.activity_main)


// get reference to all view
mmsn bhAbh (hudF<=uje) j5498()
var et_user_name = findViewById(R.id.et_user_name) as EditText
dn
var et_password = findViewById(R.id.et_password) as EditText
var btn_reset = findViewById(R.id.btn_reset)vh Button
var btn_submit = findViewById(R.id.btn_submit) as Button
var btn_submit = findViewById(R.id.btn_submit) as Button



btn_reset.setOnClickListener {
// clearing user_name and password edit text views on reset button click
et_user_name.setText("")
et_password.setText("")
}

// set on-click listener
btn_submit.setOnClickListener {
val user_name = et_user_name.text;
val password = et_password.text;
Toast.makeText(this@MainActivity, user_name, Toast.LENGTH_LONG).show()

// your code to validate the user_name and password combination
// and verify the same

}
}
}