41

Today I realized how many things can go wrong in my app.

Comments
  • 2
    Why are they all ints?
  • 1
    @theactionslacks because they are resources
  • 9
    Now I know why Microsoft chose to just show a blue screen of death, looks easier than handling all those errors 😂
  • 1
    Is the search special? It burns my eyes when I see it
  • 0
    @AlexAC35 special?
  • 0
    @Gianlu why aren't they constants. They seem like errorcodes, right?
  • 0
    @Tobyvw nope, they're not. In Android you have resources which can be of various types (string, array, boolean, ecc). These resources can be accessed via the code using thier identifiers which are ints. Using this approach is quite useful when you need to translate strings because you can set different values for each language (which are stored in different files!), the same thing can be done with other parameters such as screen dimensions. Resources are indeed not hard-coded.
  • 2
    Oh right. Android development. Get it now 👍🏻
  • 1
    @Gianlu all of the names are failed* , but there is on with the name searchFailed...I would've named it failedSearch :)
  • 0
    @AlexAC35 I feel bad for that too, I changed it 😂😂
Add Comment