clojure-android / neko

The Clojure/Android Toolkit
Other
297 stars 36 forks source link

:constructor-args with primitive values #57

Open roti opened 8 years ago

roti commented 8 years ago

I tried to use :constructor-args with a View class that has a constructor with two arguments, the second beeing a primitive int.

[:my-view {:constructor-args [256]} results in following error java.lang.NoSuchMethodException: <init> [class android.content.Context, class java.lang.Long]

[:my-view {:constructor-args [(int 256)]} results in following error java.lang.NoSuchMethodException: <init> [class android.content.Context, class java.lang.Integer]

I believe the only way to support this case, is to add some kind of special syntax or metadata to :constructor-args.

alexander-yakushev commented 8 years ago

I worked around this particular case by using :custom-constructor attribute.