title: Set onItemClick to Custom adapter ListView
body: <p>When I had problems trying to fix the position of my listView items to the desired intent when filtered, and got info I could override the problem using a custom adapter, I have done that but I do not know how to assign the clicks to each items, please check below code:</p>
  
  <pre><code>public class IndexPageActivity extends Activity { 
  ListView listView;
  EditText editTextB;
  
  @Override
  protected void onCreate(Bundle savfedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.indexpage);
      listView = (ListView) findViewById(R.id.pageList);
      editTextB = (EditText) findViewById(R.id.searchB);
      listView.setAdapter(new PagesAdapter(this));
      listView.setOnItemClickListener((OnItemClickListener) this);
  
  }
  }
  class SingleRow {
  String pagedata;
  SingleRow(String pagedata){
      this.pagedata=pagedata;
  }
  }
  class PagesAdapter extends BaseAdapter implements OnItemClickListener{
  ArrayList&lt;SingleRow&gt; pagelist;
  Context context;
  
  PagesAdapter(Context c){
      context=c;
      pagelist = new ArrayList&lt;SingleRow&gt;();
      Resources res = c.getResources();
      String [] pagedatas = res.getStringArray(R.array.pages_data);
      for (int i=0;i&lt;463;i++){
          pagelist.add(new SingleRow(pagedatas[i]));
      }
  }
  @Override
  public int getCount() {
      // TODO Auto-generated method stub
      return pagelist.size();
  }
  
  @Override
  public Object getItem(int i) {
      // TODO Auto-generated method stub
      return pagelist.get(i);
  }
  
  @Override
  public long getItemId(int i) {
      // TODO Auto-generated method stub
      return i;
  }
  
  @Override
  public View getView(int i, View view, ViewGroup viewG) {
      // TODO Auto-generated method stub
      LayoutInflater inflater=(LayoutInflater)             context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View row=inflater.inflate(R.layout.single_row,viewG,false);
      TextView pagetitle = (TextView) row.findViewById(R.id.textViewRow);
  
      SingleRow temp=pagelist.get(i);
  
      pagetitle.setText(temp.pagedata);
      return row;
  }
  @Override
  public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int i, long arg3) {
      // TODO Auto-generated method stub
  
  }
  }
  </code></pre>
  
  <p>I will appreciate any help given. Thank Yhu!</p>
  
  <p>EDIT</p>
  
  <p>Will this work?</p>
  
  <pre><code> if (index == 0) {
      Intent i = new Intent(this, WebViewActivity.class);
      i.putExtra("keyHTML", "file:///android_asset/page1.html");
      startActivity(i);
  } else if (index == 1) {
      Intent i = new Intent(this, WebViewActivity.class);
      i.putExtra("keyHTML", "file:///android_asset/page2.html");
      startActivity(i);
  </code></pre>