anOparator Active Member Licensed User Longtime User Mar 30, 2016 #1 I finally get Pause and Resume to manage the views on a screen rotation but now ImageVeiw2 does not display when the app starts up. (Because of the last line in Resume). Code: Copy Sub Process_Globals Public VisiBL As Boolean Public notVisiBL As Boolean End Sub Sub Activity_Resume Label1.Visible = VisiBL ImageView1.Visible=VisiBL ImageView2.Visible = notVisiBL ' This stops ImageView2 being visible on startup only. End Sub Sub Activity_Pause (UserClosed As Boolean) If Label1.Visible = True Then VisiBL = True notVisiBL = False Label1.Visible = VisiBL ImageView1.Visible = VisiBL ImageView2.Visible = notVisiBL Else VisiBL = False notVisiBL = True Label1.Visible = notVisiBL ImageView1.Visible = notVisiBL ImageView2.Visible = VisiBL End If End Sub I read something about Designer Scripts but since Sub_Resume is the last thing that happens the problem remains. How can I get ImageVeiw2 to display at startup? thanks for all pointers. Attachments startupFail.zip startupFail.zip 150 KB · Views: 381
I finally get Pause and Resume to manage the views on a screen rotation but now ImageVeiw2 does not display when the app starts up. (Because of the last line in Resume). Code: Copy Sub Process_Globals Public VisiBL As Boolean Public notVisiBL As Boolean End Sub Sub Activity_Resume Label1.Visible = VisiBL ImageView1.Visible=VisiBL ImageView2.Visible = notVisiBL ' This stops ImageView2 being visible on startup only. End Sub Sub Activity_Pause (UserClosed As Boolean) If Label1.Visible = True Then VisiBL = True notVisiBL = False Label1.Visible = VisiBL ImageView1.Visible = VisiBL ImageView2.Visible = notVisiBL Else VisiBL = False notVisiBL = True Label1.Visible = notVisiBL ImageView1.Visible = notVisiBL ImageView2.Visible = VisiBL End If End Sub I read something about Designer Scripts but since Sub_Resume is the last thing that happens the problem remains. How can I get ImageVeiw2 to display at startup? thanks for all pointers.
mangojack Expert Licensed User Longtime User Mar 31, 2016 #2 This in no way solves your problem .. But I found it difficult to study your code ie. Code: Copy If Label1.Visible = TrueThen VisiBL = True notVisiBL = False Label1.Visible = VisiBL ImageView1.Visible = VisiBL ImageView2.Visible = notVisiBL Else VisiBL = False notVisiBL = True Label1.Visible = notVisiBL '@@ initially I thought Label1 was NOT visible ... But notVisiBL = True .. so it Is Visable ImageView1.Visible = notVisiBL ' same here ImageView2.Visible = VisiBL 'The reverse here .. ImageView2 is Visable ... No it is NOT Visible. End If Personally I would remove the Process Globals and just set the views.Visible property True or False. Maybe look at State Manager to Save and Reset the UI on Pause and Resume .. https://www.b4x.com/android/forum/t...applications-settings-and-state.9777/#content Upvote 0
This in no way solves your problem .. But I found it difficult to study your code ie. Code: Copy If Label1.Visible = TrueThen VisiBL = True notVisiBL = False Label1.Visible = VisiBL ImageView1.Visible = VisiBL ImageView2.Visible = notVisiBL Else VisiBL = False notVisiBL = True Label1.Visible = notVisiBL '@@ initially I thought Label1 was NOT visible ... But notVisiBL = True .. so it Is Visable ImageView1.Visible = notVisiBL ' same here ImageView2.Visible = VisiBL 'The reverse here .. ImageView2 is Visable ... No it is NOT Visible. End If Personally I would remove the Process Globals and just set the views.Visible property True or False. Maybe look at State Manager to Save and Reset the UI on Pause and Resume .. https://www.b4x.com/android/forum/t...applications-settings-and-state.9777/#content
mangojack Expert Licensed User Longtime User Mar 31, 2016 #3 Looking at your code further .. You repeat the code in Activity Pause . Code: Copy If Label1.Visible = True Then VisiBL = True notVisiBL = False Label1.Visible = VisiBL 'True ImageView1.Visible = VisiBL 'True ImageView2.Visible = notVisiBL 'False Else VisiBL = False notVisiBL = True Label1.Visible = notVisiBL 'True ImageView1.Visible = notVisiBL 'True ImageView2.Visible = VisiBL 'False End If Upvote 0
Looking at your code further .. You repeat the code in Activity Pause . Code: Copy If Label1.Visible = True Then VisiBL = True notVisiBL = False Label1.Visible = VisiBL 'True ImageView1.Visible = VisiBL 'True ImageView2.Visible = notVisiBL 'False Else VisiBL = False notVisiBL = True Label1.Visible = notVisiBL 'True ImageView1.Visible = notVisiBL 'True ImageView2.Visible = VisiBL 'False End If
anOparator Active Member Licensed User Longtime User Mar 31, 2016 #4 mangojack said: This in no way solves your problem .. But I found it difficult to study your code ie. Code: Copy If Label1.Visible = TrueThen VisiBL = True notVisiBL = False Label1.Visible = VisiBL ImageView1.Visible = VisiBL ImageView2.Visible = notVisiBL Else VisiBL = False notVisiBL = True Label1.Visible = notVisiBL '@@ initially I thought Label1 was NOT visible ... But notVisiBL = True .. so it Is Visable ImageView1.Visible = notVisiBL ' same here ImageView2.Visible = VisiBL 'The reverse here .. ImageView2 is Visable ... No it is NOT Visible. End If Personally I would remove the Process Globals and just set the views.Visible property True or False. Maybe look at State Manager to Save and Reset the UI on Pause and Resume .. https://www.b4x.com/android/forum/t...applications-settings-and-state.9777/#content Click to expand... since ImageView and Label aren't UI views StateManager isn't the ticket, so I'm still at it. Am removing the Process_Globals and trying to make a variable that solves this. thanks. Upvote 0
mangojack said: This in no way solves your problem .. But I found it difficult to study your code ie. Code: Copy If Label1.Visible = TrueThen VisiBL = True notVisiBL = False Label1.Visible = VisiBL ImageView1.Visible = VisiBL ImageView2.Visible = notVisiBL Else VisiBL = False notVisiBL = True Label1.Visible = notVisiBL '@@ initially I thought Label1 was NOT visible ... But notVisiBL = True .. so it Is Visable ImageView1.Visible = notVisiBL ' same here ImageView2.Visible = VisiBL 'The reverse here .. ImageView2 is Visable ... No it is NOT Visible. End If Personally I would remove the Process Globals and just set the views.Visible property True or False. Maybe look at State Manager to Save and Reset the UI on Pause and Resume .. https://www.b4x.com/android/forum/t...applications-settings-and-state.9777/#content Click to expand... since ImageView and Label aren't UI views StateManager isn't the ticket, so I'm still at it. Am removing the Process_Globals and trying to make a variable that solves this. thanks.
mc73 Well-Known Member Licensed User Longtime User Mar 31, 2016 #5 Haven't checked your project but couldn't you just set in your process_globals Code: Copy Public notVisiBL As Boolean=true ? I ask this because I see that visiBL and notVisiBl both start with false, while in your subs I see that they get the opposite value. Upvote 0
Haven't checked your project but couldn't you just set in your process_globals Code: Copy Public notVisiBL As Boolean=true ? I ask this because I see that visiBL and notVisiBl both start with false, while in your subs I see that they get the opposite value.
anOparator Active Member Licensed User Longtime User Mar 31, 2016 #6 mc73 said: Haven't checked your project but couldn't you just set in your process_globals Code: Copy Public notVisiBL As Boolean=true ? I ask this because I see that visiBL and notVisiBl both start with false, while in your subs I see that they get the opposite value. Click to expand... I hope everyone enjoys the day because I've just read about how a Boolean defaults to False. Thanks mc73 , it works like a charm. Upvote 0
mc73 said: Haven't checked your project but couldn't you just set in your process_globals Code: Copy Public notVisiBL As Boolean=true ? I ask this because I see that visiBL and notVisiBl both start with false, while in your subs I see that they get the opposite value. Click to expand... I hope everyone enjoys the day because I've just read about how a Boolean defaults to False. Thanks mc73 , it works like a charm.
anOparator Active Member Licensed User Longtime User Mar 31, 2016 #7 mangojack said: Looking at your code further .. You repeat the code in Activity Pause . Code: Copy If Label1.Visible = True Then VisiBL = True notVisiBL = False Label1.Visible = VisiBL 'True ImageView1.Visible = VisiBL 'True ImageView2.Visible = notVisiBL 'False Else VisiBL = False notVisiBL = True Label1.Visible = notVisiBL 'True ImageView1.Visible = notVisiBL 'True ImageView2.Visible = VisiBL 'False End If Click to expand... point well taken, I should have been generating Log entries for the variables. Upvote 0
mangojack said: Looking at your code further .. You repeat the code in Activity Pause . Code: Copy If Label1.Visible = True Then VisiBL = True notVisiBL = False Label1.Visible = VisiBL 'True ImageView1.Visible = VisiBL 'True ImageView2.Visible = notVisiBL 'False Else VisiBL = False notVisiBL = True Label1.Visible = notVisiBL 'True ImageView1.Visible = notVisiBL 'True ImageView2.Visible = VisiBL 'False End If Click to expand... point well taken, I should have been generating Log entries for the variables.