title: how to get listview value and send in other activity
body: <p>hi everybody i need help i have an application with contact in list wich we can select, i want to get de value selected in the listview and send it in my second activity named View_2.xml i put the code at the end ( apologize my english i'm french).
  i know that i must use the PutExtra and GetExtra, but i need to get the value with the get(position) method but i don't know how.</p>
  
  <p>here is my mainactivity.java</p>
  
  <pre><code>package com.example.messagegroupe2;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.content.Intent;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.ListView;
  
  public class MainActivity extends Activity {
  
  private String[] mStrings = {
          "Thomas", "Audrey", "Pierre", "Paul", "Jacques",
  };
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_multiple_choice, mStrings);
  
      ListView listView = (ListView) findViewById(R.id.listview);
  
      listView.setAdapter(adapter);       
  
      final Button okButton = (Button) findViewById(R.id.Mybutton);
      okButton.setOnClickListener(new OnClickListener(){
  
          @Override
          public void onClick(View v) {
              Intent intent = new Intent(MainActivity.this, View_2.class);
              intent.putExtra(mStrings[position], );
              startActivity(intent);
  
          }
  
      });
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
      if (id == R.id.action_settings) {
          return true;
      }
      return super.onOptionsItemSelected(item);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and her is my first layout activity_main.xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical"  
  android:gravity="center"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context="com.ue236_grpE.messagegroupe.MainActivity"
  android:background="#2ECC71"  &gt;
  
     &lt;LinearLayout android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="horizontal"    &gt;
  
          &lt;ListView
              android:id="@+id/listview"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="100dp"
              android:orientation="horizontal"
              android:scrollbarStyle="insideOverlay"
              android:choiceMode="multipleChoice" /&gt;
  
     &lt;/LinearLayout&gt;
  
     &lt;Button
         android:id="@+id/Mybutton"
         android:layout_width="100dp"
         android:layout_height="50dp"
         android:layout_centerHorizontal="true"
         android:layout_marginTop="350dp"
         android:text="@string/value_button"
         android:background="#3498db"
         android:textColor="#FFFFFF" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>after i have an other view and i want to get the value of the list view and set it in this view in the TextView :</p>
  
  <pre><code>      &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="#2ECC71"
     android:gravity="center"
     android:orientation="vertical"
     android:paddingBottom="@dimen/activity_vertical_margin"
     android:paddingLeft="@dimen/activity_horizontal_margin"
     android:paddingRight="@dimen/activity_horizontal_margin"
     android:paddingTop="@dimen/activity_vertical_margin"
     tools:context="com.ue236_grpE.messagegroupe.MainActivity" &gt;
  
     &lt;Button
         android:id="@+id/button_valid"
         android:layout_width="100dp"
         android:layout_height="50dp"
         android:layout_centerHorizontal="true"
         android:layout_marginTop="300dp"
         android:layout_marginRight="10dp"
         android:text="@string/valid_button"
         android:background="#3498db"
         android:textColor="#FFFFFF" /&gt;
        &lt;Button
         android:id="@+id/button_cancel"
         android:layout_width="100dp"
         android:layout_height="50dp"
         android:layout_marginTop="300dp"
         android:layout_toRightOf="@id/button_valid"
         android:text="@string/cancel_button"
         android:background="#3498db"
         android:textColor="#FFFFFF" /&gt;
  
        &lt;TextView
            android:id="@+id/textView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="TextView" /&gt;
  </code></pre>
  
  <p></p>