internalFindViewById raises "unchecked cast" warning #2090
Comments
@WonderCsabo think we should simply put a |
That was the most easiest, however we could add unnecessary annotations
that way.
I already thought about this, I will try to hack around something.
…On Dec 1, 2017 08:14, "Kay-Uwe Janssen" ***@***.***> wrote:
@WonderCsabo <https://github.com/wondercsabo> think we should simply put
a @SuppressWarning on the generated method. What do you think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2090 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAdU5SnWHEEXv4zhbxYN1R-0Iv4EjciJks5s76dNgaJpZM4QwDPC>
.
|
okay, have fun. :) |
Not sure, but maybe we could just remove the cast for appcompat. iirc the cast is only there as appcompat required it when we implemented the |
This is a little bit more complex. Actually, this was introduced by Android Oreo. Since that version, the actual One fix would be check if the parent class has generic I am still thinking about if this possible to get rid of the generated |
Starting from recent appcompat library versions (I'm not sure which one exactly), the need to cast the result of
findViewById
seem to have gone away. In fact, if the casting in current form stays, then compiling with"-Xlint:unchecked"
will raise warnings like this:AndroidAnnotations version: 4.4.0
Android compile SDK version: 26
Annotated code:
Expected generated code:
Actual generated code:
This would probably require different style of code generation depending on the activities parent class (AppCompatActivity, Activity) and if the findViewById call supports the casting already.
The text was updated successfully, but these errors were encountered: