G grafsoft Well-Known Member Licensed User Longtime User Aug 25, 2015 #1 Hi, 1. I have a pgrogressbar, not created with the designer. I get a crash with "java.lang.NullPointerException: Attempt to write to field 'int anywheresoftware.b4a.BALayout$LayoutParams.left' on a null object reference" Code: Copy Sub Globals Dim PB As ProgressBar End Sub Sub Activity_Create(FirstTime As Boolean) PB.initialize ("Progress") PB.Visible=False PB.SetLayout (10%x,45%y,80%x,10%y) ' crashes here PB.color=Main.a400color 2. I want to intercept the event when the progressbar has reached 100%, like "Sub Progress_Jobdone" I know the trick with sub + blank + tab, but I don't get any help pn progressbar. When I try to use the designer (Generate members) - same result. 3. It must be my fault, but I do not find any documentation on this object. Last edited: Aug 25, 2015
Hi, 1. I have a pgrogressbar, not created with the designer. I get a crash with "java.lang.NullPointerException: Attempt to write to field 'int anywheresoftware.b4a.BALayout$LayoutParams.left' on a null object reference" Code: Copy Sub Globals Dim PB As ProgressBar End Sub Sub Activity_Create(FirstTime As Boolean) PB.initialize ("Progress") PB.Visible=False PB.SetLayout (10%x,45%y,80%x,10%y) ' crashes here PB.color=Main.a400color 2. I want to intercept the event when the progressbar has reached 100%, like "Sub Progress_Jobdone" I know the trick with sub + blank + tab, but I don't get any help pn progressbar. When I try to use the designer (Generate members) - same result. 3. It must be my fault, but I do not find any documentation on this object.
klaus Expert Licensed User Longtime User Aug 25, 2015 #2 1) You must add the ProgressBar onto the Activity or a Panel liky any other view added in the code ! Activity.AddView(PB, 10%x,45%y,80%x,10%y) instead of PB.SetLayout (10%x,45%y,80%x,10%y) 2) What do expect ? There is nothing 'automatic' in this view it only shows a progress but it's up to you to change the progress value depending on the function you execute, so you should know when it's finished. 3) This is from the Help. Last edited: Aug 25, 2015 Upvote 0
1) You must add the ProgressBar onto the Activity or a Panel liky any other view added in the code ! Activity.AddView(PB, 10%x,45%y,80%x,10%y) instead of PB.SetLayout (10%x,45%y,80%x,10%y) 2) What do expect ? There is nothing 'automatic' in this view it only shows a progress but it's up to you to change the progress value depending on the function you execute, so you should know when it's finished. 3) This is from the Help.