mpearson Member Licensed User Longtime User Sep 30, 2018 #1 Did something change with checkboxes? I rebuilt an application I've been running for a while and the checkbox logic has reversed. I made the following simple test app to isolate the issue. When you check the box and it enters chkOne_CheckedChange, it logs false. That's backwards, right? Code: Copy 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 chkOne As CheckBox 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") End Sub Sub Activity_Resume End Sub Sub chkOne_CheckedChange(Checked As Boolean) Log(chkOne.Checked) End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub
Did something change with checkboxes? I rebuilt an application I've been running for a while and the checkbox logic has reversed. I made the following simple test app to isolate the issue. When you check the box and it enters chkOne_CheckedChange, it logs false. That's backwards, right? Code: Copy 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 chkOne As CheckBox 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") End Sub Sub Activity_Resume End Sub Sub chkOne_CheckedChange(Checked As Boolean) Log(chkOne.Checked) End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub
Peter Simpson Expert Licensed User Longtime User Sep 30, 2018 #2 Hello @mpearson sorry but you have something wrong there as nothing as changed. Try the untested code below, no layout file is needed. Checked will equal True Unchecked will equal False Code: Copy Sub Globals Dim ChkBox1 As CheckBox End Sub Sub Activity_Create(FirstTime As Boolean) ChkBox1.Initialize("ChkBox1") Activity.AddView(ChkBox1, 0dip, 200dip, 10%x, 30dip) End Sub Sub ChkBox1_CheckedChange(Checked As Boolean) Log(Checked) End Sub Enjoy... Upvote 0
Hello @mpearson sorry but you have something wrong there as nothing as changed. Try the untested code below, no layout file is needed. Checked will equal True Unchecked will equal False Code: Copy Sub Globals Dim ChkBox1 As CheckBox End Sub Sub Activity_Create(FirstTime As Boolean) ChkBox1.Initialize("ChkBox1") Activity.AddView(ChkBox1, 0dip, 200dip, 10%x, 30dip) End Sub Sub ChkBox1_CheckedChange(Checked As Boolean) Log(Checked) End Sub Enjoy...
jimmyF Active Member Licensed User Longtime User Sep 30, 2018 #3 It's probably because it is checked as the default in the Visual Designer when the Layout was put together. So, when clicked, it would be unchecked? Just an idea...... Upvote 0
It's probably because it is checked as the default in the Visual Designer when the Layout was put together. So, when clicked, it would be unchecked? Just an idea......
mpearson Member Licensed User Longtime User Oct 1, 2018 #4 Hello @Peter Simpson Thanks for your response. Yes, I had that incorrect. Going too fast. But I still get the opposite result. @jimmyF Thanks for the idea, but it is unchecked in the visual designer. Upvote 0
Hello @Peter Simpson Thanks for your response. Yes, I had that incorrect. Going too fast. But I still get the opposite result. @jimmyF Thanks for the idea, but it is unchecked in the visual designer.
Semen Matusovskiy Well-Known Member Licensed User Oct 1, 2018 #5 Code: Copy When you check the box and it enters chkOne_CheckedChange, it logs false. Sleep a little, then Log. I see in own application that I set Sleep (50). Obviously, this is more than enough Upvote 0
Code: Copy When you check the box and it enters chkOne_CheckedChange, it logs false. Sleep a little, then Log. I see in own application that I set Sleep (50). Obviously, this is more than enough
mpearson Member Licensed User Longtime User Oct 1, 2018 #6 @Semen Matusovskiy thanks but that didn't fix it. I have this working on an app I've been running for about a year. It wouldn't compile at all earlier due to an update, so I had to update the below from 27 to 28. That seems to be when the checkbox behavior changed. Upvote 0
@Semen Matusovskiy thanks but that didn't fix it. I have this working on an app I've been running for about a year. It wouldn't compile at all earlier due to an update, so I had to update the below from 27 to 28. That seems to be when the checkbox behavior changed.
Peter Simpson Expert Licensed User Longtime User Oct 1, 2018 #7 Are you using the built-in B4A SDK Manager??? It has nothing to do with SDK 28 as I've been using 28 since it was first available for downloading with no issues whatsoever, my check boxes are just fine. Upvote 0
Are you using the built-in B4A SDK Manager??? It has nothing to do with SDK 28 as I've been using 28 since it was first available for downloading with no issues whatsoever, my check boxes are just fine.
mpearson Member Licensed User Longtime User Oct 1, 2018 #8 @Peter Simpson. Yes, I am using the built-in B4A SDK Manager. I'm not sure what caused the change, but I'm telling you something changed. Upvote 0
@Peter Simpson. Yes, I am using the built-in B4A SDK Manager. I'm not sure what caused the change, but I'm telling you something changed.
Semen Matusovskiy Well-Known Member Licensed User Oct 1, 2018 #9 Try an attached zip. It works Ok on my PC. I use android-27.jar and mavens 27.1.1. Actually, I also automatically install new mavens 28.0.0. But I had a copy of sdk folder, so I restored. BTW, I checked with new mavens and android-28. I don't see troubles. CheckBox1.Checked becomes the same as input parameter Checked. Attachments test.zip test.zip 8.8 KB · Views: 351 Last edited: Oct 1, 2018 Upvote 0
Try an attached zip. It works Ok on my PC. I use android-27.jar and mavens 27.1.1. Actually, I also automatically install new mavens 28.0.0. But I had a copy of sdk folder, so I restored. BTW, I checked with new mavens and android-28. I don't see troubles. CheckBox1.Checked becomes the same as input parameter Checked.
Peter Simpson Expert Licensed User Longtime User Oct 1, 2018 #10 Have you got both the original Android SDK and the updated B4A SDK Manager installed on your developer PC/Laptop, or just the B4A SDK Manager because you previously completely removed the original Android SDK? And no, I'm not denying that something has obviously changed, just attempting to help you if you want it. Lots of developers still had the older SDK on their machines which caused them no end of troubles until they removed it and stuck to only one, the B4A SDk manager. Upvote 0
Have you got both the original Android SDK and the updated B4A SDK Manager installed on your developer PC/Laptop, or just the B4A SDK Manager because you previously completely removed the original Android SDK? And no, I'm not denying that something has obviously changed, just attempting to help you if you want it. Lots of developers still had the older SDK on their machines which caused them no end of troubles until they removed it and stuck to only one, the B4A SDk manager.
Semen Matusovskiy Well-Known Member Licensed User Oct 1, 2018 #11 It looks that new mavens are first official release of 28.0.0. At least internally they name itself so <version>28.0.0</version> Previously was 28.0.0-alpha1, alpha2, alpha3. I have both variants - complete SDK folder according September 17 and current with mavens 28.0.0. To check what happens with new mavents I temporary rename folders and set android-28 in pathes. I think, if you support actual app, better not to risk and to use old mavens with android-27. If you write a new program, may be there is a reason to use new mavens with android-28. BTW, Android Studio with default settings does not download so new mavens. Upvote 0
It looks that new mavens are first official release of 28.0.0. At least internally they name itself so <version>28.0.0</version> Previously was 28.0.0-alpha1, alpha2, alpha3. I have both variants - complete SDK folder according September 17 and current with mavens 28.0.0. To check what happens with new mavents I temporary rename folders and set android-28 in pathes. I think, if you support actual app, better not to risk and to use old mavens with android-27. If you write a new program, may be there is a reason to use new mavens with android-28. BTW, Android Studio with default settings does not download so new mavens.
KMatle Expert Licensed User Longtime User Oct 1, 2018 #12 Checked with one of my apps using 5 checkboxes with an logic that if one checks one of the 5, other ones will be un-checked. Be careful because if you check a box by code, there might be several actions fired. I helped myself with a variable called "ItWasMe". If I change a cb by code, I set it to true to prevent any code in the event. Upvote 0
Checked with one of my apps using 5 checkboxes with an logic that if one checks one of the 5, other ones will be un-checked. Be careful because if you check a box by code, there might be several actions fired. I helped myself with a variable called "ItWasMe". If I change a cb by code, I set it to true to prevent any code in the event.
Semen Matusovskiy Well-Known Member Licensed User Oct 1, 2018 #13 Windows, as I remember, at first changes a state of Checkbox and then generates an event. Android, obviously, uses reverse order. Meanwhile (Checked As Boolean) is correct and actually you don't need to wait a moment, when Android will change a state. If Checked = True, then turn off another checkboxes. Upvote 0
Windows, as I remember, at first changes a state of Checkbox and then generates an event. Android, obviously, uses reverse order. Meanwhile (Checked As Boolean) is correct and actually you don't need to wait a moment, when Android will change a state. If Checked = True, then turn off another checkboxes.
mpearson Member Licensed User Longtime User Oct 1, 2018 #14 Semen Matusovskiy said: Try an attached zip. It works Ok on my PC. I use android-27.jar and mavens 27.1.1. Actually, I also automatically install new mavens 28.0.0. But I had a copy of sdk folder, so I restored. BTW, I checked with new mavens and android-28. I don't see troubles. CheckBox1.Checked becomes the same as input parameter Checked. Click to expand... Thanks. I'll check this out tonight. Upvote 0
Semen Matusovskiy said: Try an attached zip. It works Ok on my PC. I use android-27.jar and mavens 27.1.1. Actually, I also automatically install new mavens 28.0.0. But I had a copy of sdk folder, so I restored. BTW, I checked with new mavens and android-28. I don't see troubles. CheckBox1.Checked becomes the same as input parameter Checked. Click to expand... Thanks. I'll check this out tonight.
mpearson Member Licensed User Longtime User Oct 1, 2018 #15 Peter Simpson said: Have you got both the original Android SDK and the updated B4A SDK Manager installed on your developer PC/Laptop, or just the B4A SDK Manager because you previously completely removed the original Android SDK? And no, I'm not denying that something has obviously changed, just attempting to help you if you want it. Lots of developers still had the older SDK on their machines which caused them no end of troubles until they removed it and stuck to only one, the B4A SDk manager. Click to expand... No, just updated B4A SDK Manager. I've been running that for several months now. Upvote 0
Peter Simpson said: Have you got both the original Android SDK and the updated B4A SDK Manager installed on your developer PC/Laptop, or just the B4A SDK Manager because you previously completely removed the original Android SDK? And no, I'm not denying that something has obviously changed, just attempting to help you if you want it. Lots of developers still had the older SDK on their machines which caused them no end of troubles until they removed it and stuck to only one, the B4A SDk manager. Click to expand... No, just updated B4A SDK Manager. I've been running that for several months now.
mpearson Member Licensed User Longtime User Oct 1, 2018 #16 Semen Matusovskiy said: I think, if you support actual app, better not to risk and to use old mavens with android-27. If you write a new program, may be there is a reason to use new mavens with android-28. Click to expand... Agreed. This is a personal app that I keep adding features to. Upvote 0
Semen Matusovskiy said: I think, if you support actual app, better not to risk and to use old mavens with android-27. If you write a new program, may be there is a reason to use new mavens with android-28. Click to expand... Agreed. This is a personal app that I keep adding features to.
mpearson Member Licensed User Longtime User Oct 2, 2018 #17 Semen Matusovskiy said: Try an attached zip. It works Ok on my PC. I use android-27.jar and mavens 27.1.1. Actually, I also automatically install new mavens 28.0.0. But I had a copy of sdk folder, so I restored. BTW, I checked with new mavens and android-28. I don't see troubles. CheckBox1.Checked becomes the same as input parameter Checked. Click to expand... Here is a link to what I'm seeing. Are you recommending I revert back? https://drive.google.com/open?id=1zdusOuqIB-COxJBUd7lPVVeyIBj0_Tk_ Upvote 0
Semen Matusovskiy said: Try an attached zip. It works Ok on my PC. I use android-27.jar and mavens 27.1.1. Actually, I also automatically install new mavens 28.0.0. But I had a copy of sdk folder, so I restored. BTW, I checked with new mavens and android-28. I don't see troubles. CheckBox1.Checked becomes the same as input parameter Checked. Click to expand... Here is a link to what I'm seeing. Are you recommending I revert back? https://drive.google.com/open?id=1zdusOuqIB-COxJBUd7lPVVeyIBj0_Tk_
Peter Simpson Expert Licensed User Longtime User Oct 2, 2018 #18 I would say to delete your Android folder(s) and reinstall the whole of the SDK again, and make sure that your Java is up to date too. I always use the newest javac.exe and also the newest android.jar too. The issue isn't with B4A, but I would start with your Android folder, but that's me. I've never come across your issue before, I don't think that I've even read about it before either... Upvote 0
I would say to delete your Android folder(s) and reinstall the whole of the SDK again, and make sure that your Java is up to date too. I always use the newest javac.exe and also the newest android.jar too. The issue isn't with B4A, but I would start with your Android folder, but that's me. I've never come across your issue before, I don't think that I've even read about it before either...
mpearson Member Licensed User Longtime User Oct 2, 2018 #19 Peter Simpson said: I would say to delete your Android folder(s) and reinstall the whole of the SDK again, and make sure that your Java is up to date too. I always use the newest javac.exe and also the newest android.jar too. The issue isn't with B4A, but I would start with your Android folder, but that's me. I've never come across your issue before, I don't think that I've even read about it before either... Click to expand... That may be the way to go. It's definitely weird. I'll give it a shot later. Thanks for the help. Edit: Removing and reinstalling resolved the issue. Thanks for the suggestion. Last edited: Oct 2, 2018 Upvote 0
Peter Simpson said: I would say to delete your Android folder(s) and reinstall the whole of the SDK again, and make sure that your Java is up to date too. I always use the newest javac.exe and also the newest android.jar too. The issue isn't with B4A, but I would start with your Android folder, but that's me. I've never come across your issue before, I don't think that I've even read about it before either... Click to expand... That may be the way to go. It's definitely weird. I'll give it a shot later. Thanks for the help. Edit: Removing and reinstalling resolved the issue. Thanks for the suggestion.
Semen Matusovskiy Well-Known Member Licensed User Oct 2, 2018 #20 As I see, my test works correctly and confirms that you can use Checked parameter in Sub chkOne_CheckedChange(Checked As Boolean). Android will correct chkOne.Checked a little later. Personally I prefered to revert back to mavens 27.*.* and do not want to risk. The last signal was a confict between Design Support library, which I use, and new mavens. Android-P is not stable, why to hurry ? We make a lot of own mistakes, addition in the form of errors or incompatibilities is clearly superfluous. Upvote 0
As I see, my test works correctly and confirms that you can use Checked parameter in Sub chkOne_CheckedChange(Checked As Boolean). Android will correct chkOne.Checked a little later. Personally I prefered to revert back to mavens 27.*.* and do not want to risk. The last signal was a confict between Design Support library, which I use, and new mavens. Android-P is not stable, why to hurry ? We make a lot of own mistakes, addition in the form of errors or incompatibilities is clearly superfluous.