比较字符串从bundle到本地值

TJ *_*dle 0 java android bundle

我已经尝试了几十种不同的组合,我不知道为什么它不起作用 - 它的逻辑完全合理.

我正在从先前的活动传递一个包,该活动已将值从微调器存储到字符串中.我正在读取字符串,如果它与我指定的任何内容相同 - 就是按照那个方式行事.

我已经将字符串直接打印到TextView,以确保我得到预期的结果,而我 - 但它仍然不会注册.

    TextView tv;

    Bundle extras = getIntent().getExtras();
    tv = (TextView) findViewById(R.id.textView2);
    tv.append(extras.getString("pageNumber"));
    tv = (TextView) findViewById(R.id.textView3);
    int base = Integer.parseInt(extras.getString("pageNumber")) * 70;
    tv.append(Integer.toString(base));

/* Here is where I'm editing */
    tv = (TextView) findViewById(R.id.textView4);
    String plat = extras.getString("platform");
    if (plat == "Wordpress") tv.append("900");
Run Code Online (Sandbox Code Playgroud)

我的spinner的数组在我的strings.xml中定义,如下所示:

    <string-array name="platform_array">
    <item>None</item>
    <item>Joomla</item>
    <item>Wordpress</item>   
    <item>Drupal</item>
</string-array>
Run Code Online (Sandbox Code Playgroud)

Pet*_*ton 5

==是比较两个对象,equals还是equalsIgnoreCase比较两个对象的值.