title: ListView Item to webView in Main Activity
body: <p>What I am trying to do is load a URL in a webView in the main activity from a populated listView item.  I am not sure how to do this and I am learning step by step, working my way to eventually adapt this to populating the listView with a dataBase once I learn this step (in this question).</p>
  
  <p>The getURL variable needs to be used to load the link into mWebView in the .main activity when the list item object is clicked.  (make sense??)
  Thanx for your help!!
  <br>
  <br>
  Below is what I have so far:</p>
  
  <p>the listView activity (ACList.java):</p>
  
  <pre><code>public class ACList extends Activity 
  {
      @Override
      public void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      setContentView(R.layout.ac_list);
  
      ArrayList&lt;SearchResult&gt; searchResults = GetSearchResults();
  
      final ListView lv1 = (ListView) findViewById(R.id.listItems);
      lv1.setAdapter(new MyCustomBaseAdapter(this, searchResults));
  
      lv1.setOnItemClickListener(new OnItemClickListener() 
      {
           public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) 
           { 
                Object o = lv1.getItemAtPosition(position);
                SearchResult fullObject = (SearchResult)o;
                Toast.makeText(ACList.this, "You have chosen: " + " " + fullObject.getLabel(), Toast.LENGTH_LONG).show();
                /** -- Here is the Class I intend to start with the specified URL to the selected item
                Intent i = new Intent(ACList.this, main.class);
                i.putExtra("url", fullObject.getURL());
                startActivity(i);
                **/
           }  
      });
  
  }
  
      private ArrayList&lt;SearchResult&gt; GetSearchResults()
      {
           ArrayList&lt;SearchResult&gt; results = new ArrayList&lt;SearchResult&gt;();
  
           SearchResult sr1 = new SearchResult();
           sr1.setLabel("The Lable");
           sr1.setListTitle("This is the Title");
           sr1.setCaption("This is what its about");
           sr1.setURL("http://www.somesite.com/index.html");
           results.add(sr1);
      }
  }
  </code></pre>
  
  <p><br>
  <br>
  This is my Adapter (MyCustomBaseAdapter):</p>
  
  <pre><code>public class MyCustomBaseAdapter extends BaseAdapter {
   private static ArrayList&lt;SearchResult&gt; searchArrayList;
  
   private LayoutInflater mInflater;
  
   public MyCustomBaseAdapter(Context context, ArrayList&lt;SearchResult&gt; results) {
    searchArrayList = results;
    mInflater = LayoutInflater.from(context);
   }
  
   public int getCount() {
    return searchArrayList.size();
   }
  
   public Object getItem(int position) {
    return searchArrayList.get(position);
   }
  
   public long getItemId(int position) {
    return position;
   }
  
   public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder;
    if (convertView == null) {
     convertView = mInflater.inflate(R.layout.list_item, null);
     holder = new ViewHolder();
     holder.txtLabel = (TextView) convertView.findViewById(R.id.label);
     holder.txtListTitle = (TextView) convertView.findViewById(R.id.listTitle);
     holder.txtCaption = (TextView) convertView.findViewById(R.id.caption);
  
     convertView.setTag(holder);
    } else {
     holder = (ViewHolder) convertView.getTag();
    }
  
    holder.txtLabel.setText(searchArrayList.get(position).getLabel());
    holder.txtListTitle.setText(searchArrayList.get(position).getListTitle());
    holder.txtCaption.setText(searchArrayList.get(position).getCaption());
  
    return convertView;
   }
  
   static class ViewHolder {
    TextView txtLabel;
    TextView txtListTitle;
    TextView txtCaption;
   }
  }
  </code></pre>
  
  <p><br>
  <br>
  ...and my SearchResult.java:</p>
  
  <pre><code>public class SearchResult 
  {
   private String label = "";
   private String listTitle = "";
   private String caption = "";
   private String listURL = "";
  
   public void setLabel(String label) {
    this.label = label;
   }
  
   public String getLabel() {
    return label;
   }
  
   public void setListTitle(String listTitle) {
    this.listTitle = listTitle;
   }
  
   public String getListTitle() {
    return listTitle;
   }
  
   public void setCaption(String caption) {
    this.caption = caption;
   }
  
   public String getCaption() {
    return caption;
   }
  
   public void setURL(String listURL) {
        this.listURL = listURL;
       }
  
       public String getURL() {
        return listURL;
       }   
  }
  </code></pre>