Hi everyone, I need help quickly please.
I can't click button login once to login. I have to click it twice.
Maybe there's something wrong with my code. Please take a look.
I though the problem is my for..next code run before poststring is finished.
i put the JobDone sub in a service module.
Thanks before.
I can't click button login once to login. I have to click it twice.
Maybe there's something wrong with my code. Please take a look.
I though the problem is my for..next code run before poststring is finished.
i put the JobDone sub in a service module.
B4X:
'Activity module
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.
Dim job1 As HttpJob
Dim tb_user As EditText
Dim tb_pass As EditText
Dim ImageView1 As ImageView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Activity.Title = "SI SMK Yamasi"
Activity.LoadLayout("lay_login")
'Msgbox(Activity.Width,"Info")
job1.Initialize("job1",serv_var)
ImageView1.Top = Activity.Height - 400
End Sub
Sub Activity_Resume
ImageView1.Top = Activity.Height - 400
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub posting
job1.PostString(mod_var.server_url,"Select tb_user.username, tb_user.pass from tb_user where username = '" & tb_user.text & "' and pass = '" & tb_pass.Text & "'")
End Sub
Sub bt_login_Click
CallSubDelayed(Me,"posting")
If job1.Success = True Then
For i = 0 To serv_var.rows.Size - 1
Dim m As Map
m = serv_var.rows.get(i)
If tb_user.Text = m.Get("username") AND tb_pass.Text = m.Get("pass") Then
StartActivity(act_main_menu)
Activity.Finish
End If
'Msgbox("Username : " & m.Get("username") & ", Password : " & m.Get("pass"),"Success")
Next
End If
End Sub