Professional Documents
Culture Documents
Android Studio Lab 6
Android Studio Lab 6
6- Set the hint of the Email to username, and assign an ID for it.
7- Set the hint of the password to pass and assign an ID for it.
9- In the main activity, write a code to check the entered text to the username and password,
“Login fail”.
Hint Code
buttonlg.setOnClickListener {
var status= if (usernamee.text.toString().equals("mobina.beheshti") &&
pass.text.toString().equals("123mb"))
"Logged In Successfully" else "LogIn Fail"
Toast.makeText( this , status, Toast.LENGTH_SHORT).show()
}
An Android Toast is a small message displayed on the screen, similar to a tool tip or other
similar popup notification. A Toast is displayed on the main content of an activity, and only
remains visible for a short time period.