title: on spinner item selected in activity one, textview in the second activity must be changed
body: <p>I'm a beginner to android and i got stuck with a problem.
  i have spinner in Main Activity, and on item selection from spinner, the text in the Text View of second Activity must be changed according to the item selected.
  Here everything is fine after using On Click Listener, and set text in Main Activity with if statements with content Equals. 
  spinner is loading and on item selected, app is crashing.
  So what should i write in Second Activity?</p>
  
  <p>below is my Main Activity</p>
  
  <pre><code>public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int i, long id) {
  
          String s = String.valueOf(s.getSelectedItem());
  
  
  
          if (s.contentEquals("A")) {
  
              textToChange.setText(R.string.PH);
              Intent intent = new Intent(MainActivity.this, Main2Activity.class);
              startActivity(intent);
  
          }
          else {
              textToChange.setText(R.string.PH1);
              Intent intent = new Intent(MainActivity.this, Main2Activity.class);
              startActivity(intent);
  
          }
  
      }
          @Override
          public void onNothingSelected (AdapterView &lt; ? &gt; adapterView){
  
          }
  
      };
  </code></pre>