Android Question Activity create first time problem

anaylor01

Well-Known Member
Licensed User
Longtime User
When the user click a button the code below runs. Well what seems to be happening is that it runs this code then it runs the Activity create first time code again and then the activity resume code too. I don't know what I am missing. It should run the code below and stop.

Sub btnDone_Click
pnlmain1.Visible = True
pnlmain2.Visible = True
sql1.ExecNonQuery("Update Data set VIN = '" & edtVIN.text & "'")
sql1.ExecNonQuery("Update Data set vyear = '" & edtVehicleYear.text & "'")
sql1.ExecNonQuery("Update Data set make = '" & edtVehicleMake.text & "'")
sql1.ExecNonQuery("Update Data set model = '" & edtVehicleModel.text & "'")
Activity.LoadLayout("card")

lblEffectiveDate.Text = DateTime.Date(DateTime.Add(DateTime.Now, 0, 0, -60))
lblExpirationDate.Text = DateTime.Date(DateTime.Add(DateTime.Now, 0, 0, 120))

lblName.text = sql1.ExecQuerySingleResult("SELECT name FROM data")
lblAddress.Text = sql1.ExecQuerySingleResult("SELECT address FROM data")
lblVIN.text = sql1.ExecQuerySingleResult("SELECT VIN FROM data")
lblVehicleYear.text = sql1.ExecQuerySingleResult("SELECT vyear FROM data")
lblMake.text = sql1.ExecQuerySingleResult("SELECT make FROM data")
lblModel.text = sql1.ExecQuerySingleResult("SELECT model FROM data")
Activity.BringToFront
phn.SetScreenOrientation(0)
imgCard.Height = DeviceValues.Height
imgCard.Width = DeviceValues.Width
End Sub
 

anaylor01

Well-Known Member
Licensed User
Longtime User
I need some help. I need to change the orientation and to stretch out the image. I am trying the code below.
Activity.LoadLayout("card")
phn.SetScreenOrientation(0)
Activity.Height = DeviceValues.Height
Activity.Width = DeviceValues.Width
 
Upvote 0
Top