You cannot check the emptiness of a String using the "=" operator!
You would need to use the equals method which is a method in the
String class
String yourString = someEditText.getText().toString();
if (yourString.equals("") ){
}
--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.
On Oct 20, 1:48 pm, JasonMP <[email protected]> wrote:
> using "if(someEditText.getText().toString == null) " doesnt work
>
> im passing information from this editText into a database. Ive
> already limited it to 2 characters and numbers only in the xml file,
> but i need to run a check to fill its defaults to 0 if nothing is
> entered. I could set its default to 0, but then my hint text would
> show up. Could someone give me a hand with this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---