Java Question Wrapping a class...

Johan Schoeman

Expert
Licensed User
Longtime User
I have a Java class that is defined as follows:

B4X:
public class GraphicOverlay<T extends GraphicOverlay.Graphic> extends View {

So, I am trying to do the following in my wrapper but it is obviously wrong:

B4X:
public class overlayWrapper extends ViewWrapper<<T extends GraphicOverlay.Graphic>> implements DesignerCustomView {

How should the wrapper's definition look like?

Have also tried with:

B4X:
public class overlayWrapper extends ViewWrapper<GraphicOverlay<T extends GraphicOverlay.Graphic>> implements DesignerCustomView {

Thanks

JS
 

Johan Schoeman

Expert
Licensed User
Longtime User
What happens with:
B4X:
public class overlayWrapper extends ViewWrapper<GraphicOverlay.Graphic> implements DesignerCustomView {
I then get this error @Erel:

B4X:
C:\Users\----------2\Documents\Basic 4 Android\BATTELING\VisionBarcodeEmbedded\barcode-reader\app\src\barcodereaderwrapper\overlayWrapper.java:77: error: type argument Graphic is not within bounds of type-variable T
public class overlayWrapper extends ViewWrapper<GraphicOverlay.Graphic> implements DesignerCustomView {
                                                              ^
  where T is a type-variable:
    T extends View declared in class ViewWrapper
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error


Error.
 
Top