#Region Activity Attributes
#FullScreen: False
#IncludeTitle: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private EmailTxt As EditText
Private PasswordTxt As EditText
Private LoginBtn As Button
Dim Curs1 As Cursor
Dim SQlScript As String
Dim Local_Email, Local_Password As String
Dim Local_PASSWORDCHANGED As Int
Dim Ime1 As IME
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("Login.bal")
Ime1.Initialize("")
Ime1.SetCustomFilter (EmailTxt, EmailTxt.INPUT_TYPE_TEXT, "abcdefghijklmnopqrstuvwxyz1234567890.@-_")
Ime1.AddHeightChangedEvent
SQlScript = "Select * from LOCAL_Settings"
Starter.LocalSQL.Initialize(File.DirRootExternal & "/DroidViewDB/", "DVDatabase.db", True)
Curs1 = Starter.LocalSQL.ExecQuery(SQlScript)
For i = 0 To Curs1.RowCount - 1
Curs1.Position = i
Local_Email = Curs1.GetString("EMAIL")
Local_Password = Curs1.GetString("PASSWORD")
Local_PASSWORDCHANGED = Curs1.GetInt("PASSWORDCHANGED")
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub LoginBtn_Click
Log(Local_Email.CompareTo(EmailTxt.Text)) Result -----> [email protected] = [email protected]
Log(EmailTxt.Text.Length & " " & Local_Email.Length) Result -----> 80 80
If Local_Email.CompareTo(EmailTxt.Text) = 0 Then
Wait For (CallSub(Me, "ChangePass")) Complete (Result As Boolean)
If Result Then
Activity.Finish
Else
ToastMessageShow("Η αλλάγή του κωδικού δεν ολοκληρώθηκε.", True)
End If
Else
ToastMessageShow("Το Email δεν είναι σωστό.", True)
End If
End Sub
Sub ChangePass As ResumableSub
Return True
End Sub