title: get selected item from single selection mode listview - android
body: <p>anyone please tell me, how can i get selected from listview.?
  my single item row from listview contains a text followed by a radiobutton.</p>
  
  <p>Code:
  XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical" &gt;
  
      &lt;ListView
          android:id="@+id/listview"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:choiceMode="singleChoice"
      /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and activity:</p>
  
  <pre><code>public class MainActivity extends Activity {
      String[] countries = new String[] {
          "India",
          "Pakistan",
          "Sri Lanka",
          "China",
          "Bangladesh",
          "Nepal",
          "Afghanistan",
          "North Korea",
          "South Korea",
          "Japan"
      };
  
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          // Getting object reference to listview of main.xml
          ListView listView = (ListView) findViewById(R.id.listview);
  
          // Instantiating array adapter to populate the listView
          // The layout android.R.layout.simple_list_item_single_choice creates radio button for each listview item
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_single_choice,countries);
  
          listView.setAdapter(adapter);
  
      }
  }
  </code></pre>
  
  <p>the code working fine..<br>
  but my questions are<br>
   1) how to set default selection  ?<br>
                        2) get selected item  ?  </p>