Use string1.equalsIgnoreCase("something)
or .equals("Something");
With ==
(for strings) in java you are comparing they are of same reference. Like you did is the test if both of them are strings objects.
More Related Contents:
- how to do substring of HttpResponse in android
- Substring a string from both end in java [duplicate]
- Android String that change every day
- Read/Write String from/to a File in Android
- Subscript and Superscript a String in Android
- How to convert a color integer to a hex String in Android?
- String comparison – Android [duplicate]
- Android Split string
- Converting a string to an integer on Android
- How to escape % in String.Format?
- Convert seconds value to hours minutes seconds?
- How do you pass a string from one activity to another? [duplicate]
- getString Outside of a Context or Activity
- Fatal Error: Invalid Layout of java.lang.String at value
- How to get data from each dynamically created EditText in Android?
- Android – how to replace part of a string by another string?
- How can I start a new android activity using class name in a string?
- Convert String to Uri
- == and .equals() not working in java [duplicate]
- How to remove only trailing spaces of a string in Java and keep leading spaces?
- Android coding with switch (String)
- Is it possible to change the text color in a string to multiple colors in Java?
- How to check whether given string is a word
- What’s the best way to check if a String contains a URL in Java/Android?
- Random element from string array [closed]
- How to split a string in Java
- Delete data from ArrayList with a For-loop
- android.util.AndroidRuntimeException: requestFeature() must be called before adding content
- TCP\IP client – EHOSTUNREACH (No route to host)
- how to merge to two bitmap one over another