title: how set the text of textview with listitem when the listitem is clicked
body: <p>I want to set the text of textview with listitem when a list item is clicked.
  i have list of items. when i click on an item it displays the html page. i have layout to display the HTML page(Using WebView), heading(TextView) and back button(Imagebutton).i am able to display the html page in  webview without any problem. Problem is with the heading. when i click on list item of list. i want the same item to be set as heading in the textview. Please suggest me. i am able to toast the listitem, but i do not need it. i want to set in text of textview.please see the below code.</p>
  
  <p>Topics.java</p>
  
  <pre><code>public class Topics extends ListActivity {
  
  @Override
      public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
            // storing string resources into Array
            String[] topic_sections =   getResources().getStringArray(R.array.topic_sections);
  
      // Binding resources Array to ListAdapter
           this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, R.id.label, topic_sections));
  }     
  
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
      super.onListItemClick(l, v, position, id);
      change(position);
      }
  void change(int position){
     switch(position){  
              case 0 :{
          Intent intent = new Intent(getApplicationContext(), TopicsDisplay.class);
          intent.setData(Uri.parse("file:///android_asset/home.html"));
          startActivity(intent);
              }
             break;
  
      case 1 :{
          Intent intent = new Intent(getApplicationContext(), TopicsDisplay.class);
          intent.setData(Uri.parse("file:///android_asset/program.html"));
          startActivity(intent);}
             break;
  
         } } }
  </code></pre>
  
  <p>TopicsDisplay.java</p>
  
  <pre><code>public class TopicsDisplay extends Activity {
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  this.setContentView(R.layout.topic_display);
  
  
  WebView webview1 = (WebView) findViewById(R.id.webView1);
  webview1.loadUrl(getIntent().getDataString());
  webview1.getSettings().setBuiltInZoomControls(true);
  webview1.setInitialScale(1);
  webview1.setPadding(0, 0, 0, 0);
  
  
  
  
   }
  
   public void finishActivity(View v){
   finish();
    }
  
    }
  </code></pre>
  
  <p>list_item.xml</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;!--  Single List Item Design --&gt;
   &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/label"
        android:textColor="#ea9999"
        android:background="#000000"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="10dp"
        android:textSize="20sp"
        android:textStyle="bold" 
        android:focusable="false"  
        android:clickable="false"&gt;
   &lt;/TextView&gt;
  </code></pre>
  
  <p>topic_display.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:orientation="vertical" 
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="@color/myBackground"&gt;
  
   &lt;RelativeLayout 
  
      android:orientation="horizontal" 
      android:layout_width="fill_parent"
      android:layout_height="wrap_content" &gt;
  
  
      &lt;ImageButton
      android:id="@+id/imageButton1"
      android:layout_width="42dp"
      android:layout_height="42dp"
      android:onClick="finishActivity"
      android:contentDescription="@string/back"
      android:src="@drawable/back_button" /&gt;
  
      &lt;TextView 
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_marginLeft="45dp" 
      android:textStyle="bold"
      android:textColor="#000000"
      android:gravity="center_vertical"
      android:layout_alignParentRight="true"
      android:layout_centerVertical="true"
      android:paddingLeft="10dp"
      android:id="@+id/header"
  
      /&gt;
  
   &lt;/RelativeLayout&gt;
  
   &lt;WebView 
  
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" 
      android:id="@+id/webView1"/&gt;
  
  
   &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>After getting the item from the list view how to set that listitem in the text of textview which is there in the  topic_display layout.</p>