I'm sorry to be asking so many questions today. However, I have been working on the issues for a considerable amount of time and this IS the last resort.
My question is as follows:
I'm using the seekbar but it is behaving rather weirdly. Here is the code...
I want to show the panel "R" when the seekbar "SB1" has the highest value out of the other seekbars. Once I have this problem resolved I will be showing different panels following different scenarios with the seekbars. When I include the image "IMG_1781" it just automatically closes the app. When I comment it out (by putting a ' ) the label "a" is not initialized even when I set SB1 with the highest value. Because of this the 'else' scenario takes place and I am taken to home.
Cheers,
Neil
My question is as follows:
I'm using the seekbar but it is behaving rather weirdly. Here is the code...
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 scrollview1 As ScrollView
Dim button1 As Button
Dim Back As Button
Dim Panel1 As Panel
Dim PR As Button
Dim SB1, SB2, SB3, SB4, SB5, SB6 As SeekBar
Dim ImageView1 As ImageView
Dim label1 As Label
Dim a As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
activity.LoadLayout("RCAre.bal")
ScrollView1.Panel.LoadLayout("RCArePanel")
ScrollView1.Panel.Height = Panel1.Height
End Sub
Sub Back_click
StartActivity("main")
End Sub
Sub button1_click
ScrollView1.Panel.LoadLayout("DG")
ScrollView1.Panel.Height = Panel1.Height
If SB1.Value > SB2.Value AND SB1.Value > SB3.Value AND SB1.Value > SB4.Value AND SB1.Value > SB5.Value AND SB1.Value > SB6.Value Then
a.Initialize("a")
End If
End Sub
Sub PR_Click
If a.IsInitialized Then
ScrollView1.Panel.LoadLayout("R")
ScrollView1.Panel.Height = Panel1.Height
label1.Text = ("Scrape a little cane away from the base of the blade as shown below")
'imageview1.Bitmap = LoadBitmap(File.DirAssets, "IMG_1781.jpg")
Else
ToastMessageShow ("Unfortunately your results could not be processed. Thus, you are being taken to the home page", True)
StartActivity ("main")
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
activity.Finish
End Sub
I want to show the panel "R" when the seekbar "SB1" has the highest value out of the other seekbars. Once I have this problem resolved I will be showing different panels following different scenarios with the seekbars. When I include the image "IMG_1781" it just automatically closes the app. When I comment it out (by putting a ' ) the label "a" is not initialized even when I set SB1 with the highest value. Because of this the 'else' scenario takes place and I am taken to home.
Cheers,
Neil