Hopefully this is an easy fix, but for the moment is is boggling me (Actionscript programmer new to Java programming).
I have a string variable coming from getExtra
"vuqar"=="vuqar"
or "vuqar"!="vuqar"
not works correct
You have to use
if(vuqar.equals("vuqar")){//action}
OR
if(!"vuqar".equals("vuqar")){//action}
You must not compare strings via ==
, but via .equals()
Use the equals method instead of ==
You should use equals for Strings on Java.
2 tips:
Strings are Objects, and to do correct Object equality comparisions, you need to use
dir.equals("content");
or better yet (to avoid possible null pointer exceptions)
"content".equals(dir);