Hello
I am moving the code I have written around the AHdashboard example to a class in order to reuse it with different projects. I am running into a problem as follows:
I had certain Views such as Button1, Label1, etc that were originally declared in the Main Activity Sub Globals subroutine. I had moved these and others into my Sub Class_Globals subroutine and am running into a java runtime error " Object should be first be initialized (Label) Did you forget to call Activity.LoadLayout?" The code is assembling buttons and labels one-by-one on a Panel to be displayed as a dashboard. I am initializing the class prior to invoking the code that assembles the buttons. If I add code to initialize the lanel and button withing the assembly loop the error goes away but the buttons do not work anymore.
I assume that moving the Sub Globals variables into my class would have no effect on the original operation of my app. Is there a difference. I have looked all over the forum here for an answer but haven't found any answers, If I move my variables back into my Main module they are not accessible by by class since they are private to Main.
We need more info on porting our existing apps to use the new class feature in v2.00. Has anyone run into this problem? I have upgraded to v2.02.
Regards,
Ray
I am moving the code I have written around the AHdashboard example to a class in order to reuse it with different projects. I am running into a problem as follows:
I had certain Views such as Button1, Label1, etc that were originally declared in the Main Activity Sub Globals subroutine. I had moved these and others into my Sub Class_Globals subroutine and am running into a java runtime error " Object should be first be initialized (Label) Did you forget to call Activity.LoadLayout?" The code is assembling buttons and labels one-by-one on a Panel to be displayed as a dashboard. I am initializing the class prior to invoking the code that assembles the buttons. If I add code to initialize the lanel and button withing the assembly loop the error goes away but the buttons do not work anymore.
I assume that moving the Sub Globals variables into my class would have no effect on the original operation of my app. Is there a difference. I have looked all over the forum here for an answer but haven't found any answers, If I move my variables back into my Main module they are not accessible by by class since they are private to Main.
We need more info on porting our existing apps to use the new class feature in v2.00. Has anyone run into this problem? I have upgraded to v2.02.
Regards,
Ray