3
koolkvd
7y

Resource not found exception occurred when i tried to set an integer text inside a TextView in android.

Spent an hour trying to comb through my entire android app's layout resources looking at all the declared ids and cross checking then.

Didn't work. Tried googling and stumbled upon a stray human who had encountered a similar issue.

Turns out if you print an integer inside the setText, it will not consider it a normal printable value, it will think that's it's a resource id and try to use it.

Fucking misleading exception. FML ANDROID

Comments
  • 2
    Came to know that when I decompiled a few android apps and all of the IDs in java files were numbers.
  • 1
    @htlr they should just stop allowing integers inside the method. I had been lucky so far because i usually used long or double and they aren't allowed. Integer was and i was like how convenient, so nice of them to not make me convert it... Little did i know 😂
  • 3
    @koolkvd first they need to remove the dark magic inside android studio 😂 that thing goes crazy sometimes.
  • 1
    @htlr yea omfg that is so irritating. That is after the R not found bullshit. I mean who the fuck made the auto generating part? They should be stoned publicly. Indexing is utterly stupid in AS
  • 2
    @koolkvd things are a little better now with Kotlin ❤️
Add Comment