Android Tutorial [java] Custom View with Designer Support (Java library)

daemon

Active Member
Licensed User
Longtime User
Oh! I wrote that too early...

I see other attributes now but when trying to use any of them programatically, I get Object should first be initialized exception. I must be doing something wrong.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It will be difficult to combine ViewWrapper with a custom view.

There is a simpler option. You can expose the "base" view as a property and then the user will be able to access its properties:
B4X:
public ViewWrapper getView() {
 ViewWrapper vw = new ViewWrapper();
 vw.Object = <base view>;
 return vw;
}

B4A:
B4X:
CustomView.View.Visible = False
 

daemon

Active Member
Licensed User
Longtime User
Using that code, Eclipse gives warning that ViewWrapper is a raw type.
Even if I ignore that warning, B4A gives compilation error saying Unknown type android.view.ViewWrapper
 
Top