title: Passing Listview string to another activity Using Android Intent
body: <p>I'm trying to pass a string from Listview using intent. but I cant do it correctly. can anybody help me to find error in this code. thank you </p>
  
  <p><strong>First  Activity</strong></p>
  
  <pre><code>public class MainActivity2 extends ActionBarActivity implements AdapterView.OnItemClickListener {
      ListView ListView1;
  
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main_activity2);
          ListView1 = (ListView) findViewById(R.id.listView1);
          ListView1.setAdapter(new ArrayAdapter&lt;String&gt;(MainActivity2.this, android.R.layout.simple_list_item_1, getResources().getStringArray(R.array.sms)));
  ListView1.setOnItemClickListener(this);
  
  
      }
      @Override
      public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {
          String value =(String) ListView1.getSelectedItem();
  
  
          Intent a = new Intent(MainActivity2.this,MainActivity7.class);
  
  a.putExtra("item",value);
  
  
          startActivity(a);
  
      }
  }
  </code></pre>
  
  <p>Second Activity</p>
  
  <pre><code>public class MainActivity7 extends ActionBarActivity {
  String value ;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main_activity7);
  
        TextView editText = (TextView) findViewById(R.id.editText);
          Intent a = getIntent();
  
        editText.setText(a.getStringExtra("item")  );
   }
  }
  </code></pre>