Android Question moving on to classes but I'm stuck with addview

sorex

Expert
Licensed User
Longtime User
I'm changing some code module to a class as it seems more flexible and easier to use with some activity views.

But can we use addview inside classes aswell?

I'm stuck at this...

B4X:
btnMenu.Initialize("menubutton")
Main.AddView(btnMenu,0,0,0,0)

the last line gives an "Unknown member : addview" error, it only list the global stuff.

I can declare an activity variable but I don't know how to link my main activity to it.

I'm also not able to access a view in my Main activity, altho I can bypass it by storing the position/size in a variable in the main activity tho so it's less important.

I went throught the classes tutorial thread but it doesn't reveal much on this topic.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…