New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
illegalArgumentException: The key must be an application-specific resource id #25
Comments
So this may very well be related to the fact that I am calling |
I don't think so. I would suggest it's a limitation of setTag(id, value) - try using IDs over 0x80000000, otherwise android treats this as an invalid ID and throws an exception. |
Well, I'm not using ids (like none of the examples do). So am I supposed to call |
Sorry, I'm not talking about view ids. What kind of |
I'm not setting anything explicitely, which is why I'm confused. I am using Kotlin with the view helpers if that's relevant. For the heck of it, I tried calling |
So here's one of the views I'm testing with: class StartupView(c: Context) : RenderableView(c) {
companion object {
val TAG = "StartupView"
}
override fun view() : Nodes.ViewNode {
setId(0x10000001)
Log.i(TAG, "::view")
val params = LinearLayout.LayoutParams(WRAP, WRAP)
params.gravity = Gravity.CENTER
return v<LinearLayout> {
-size(FILL, FILL)
-orientation(LinearLayout.VERTICAL)
-gravity(CENTER)
-backgroundColor(Color.parseColor("#ffe0e0"))
//-layoutParams(params)
v<LinearLayout> {
-orientation(LinearLayout.HORIZONTAL)
-gravity(CENTER_HORIZONTAL)
-size(FILL, WRAP)
-backgroundColor(Color.parseColor("#e0ffe0"))
v<TextView> {
-text("Initializing..")
}
}
}
}
} Yes, it has some inactive code (params etc) which shouldn't affect anything. I also tested |
This code from @Override
public int hashCode() {
return value == null ? value.hashCode() : 0;
} I would assume null should return zero, and hashCode otherwise. But I'm just guessing. |
Ok, Anvil 0.1.x doesn't use setTag with IDs anymore, and most of the issues referred to in this thread are gone (like broken hashCode implementation), so I'll probably close this issue. |
Hi @mariusk : you may very well use setTag with IDS , but make sure you define these ids in strings.xml file |
@mariusk @droidfreak8931 Mostly true, except for IDs should rather be declared in |
After introducing a few more view to my app using anvil, it starts throwing these when I switch views calling
setContentView
:Any ideas why, and/or what I need to do to fix it?
The text was updated successfully, but these errors were encountered: