3 ms·
Even Java would have caught that assuming .show() is Java's .toString().
by zeckalpha 11y ago
Even Java would have caught that assuming .show() is Java's .toString().
- mcherm 11y agoNope. Creating a Toast object just creates the object. Calling .show() on the newly created object is what makes it actually draw something on the screen. The difficulty here is to realize that "new Toast(myMessage)" is not enough, you need to execute "new Toast(myMessage).show()". By the way, I am 100% sure that Java wouldn't have caught that, because this IS Java.
- e12e 11y agoI'm not sure how one would encode that information in java. Isn't toString() a special case in java? If you try to cast any object to a String, something (String?) will look for the toString class. I'm not sure what the equivalent would be for a widget that can be perfectly valid to add to another widget both in a hidden, and show()n state? To compare with toString, it's more like if you didn't do obj.show(), obj.toString() would return the empty string?