[android-developers] String isEmpty()

2011-11-01 Thread Doug Gordon
Why in the world would my app crash with a No such method Java error on a statement like if (!myString.isEmpty() for a perfectly valid String object? If I simply change it to if (myString.length() 0) it works just fine, so it's not like I'm not pointing to a valid String object or anything.

Re: [android-developers] String isEmpty()

2011-11-01 Thread Mark Murphy
On Tue, Nov 1, 2011 at 3:40 PM, Doug Gordon gordo...@gmail.com wrote: Why in the world would my app crash with a No such method Java error on a statement like if (!myString.isEmpty() for a perfectly valid String object? If I simply change it to if (myString.length() 0) it works just fine, so

Re: [android-developers] String isEmpty()

2011-11-01 Thread Romain Guy
Because String.isEmpty() didn't exist in 2.2. You can verify this by looking at http://developer.android.com/reference/java/lang/String.html#isEmpty() and checking the Filter by API level option at the top. You should use TextUtils.isEmpty() instead. On Tue, Nov 1, 2011 at 12:40 PM, Doug Gordon

Re: [android-developers] String isEmpty()

2011-11-01 Thread Marc Petit-Huguenin
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/01/2011 12:40 PM, Doug Gordon wrote: Why in the world would my app crash with a No such method Java error on a statement like if (!myString.isEmpty() for a perfectly valid String object? If I simply change it to if (myString.length() 0) it

Re: [android-developers] String isEmpty()

2011-11-01 Thread Doug Gordon
On 11/1/2011 3:45 PM, Marc Petit-Huguenin wrote: The method String.isEmpty() exists only since Java 1.6/Android API 9. Thanks. That explains a lot. This was a recent change. I thought surely I'd used that method before, but when I searched my entire project, isEmpty was nowhere to be found!