Intent字符串值不等于相同的字符串字符

时间:2013-07-27 04:47:05

标签: android

我对此很困惑:

Intent i = new Intent(this, Another.class);

String typeImg = "image";
i.putExtra("mapType", typeImg);
startActivity(i);

Another.class

Intent in = getIntent();
String mapType = in.getStringExtra("mapType");

但如果我比较一下:

if (mapType == "image") {
    return true;
} else {
    return false;
}

返回 false

有人可以解释我错过了什么吗?

感谢。

0 个答案:

没有答案
相关问题