Hey I am trying to display a web view if someone clicks on the 5th item in a list.
This is the code:
          lv.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> a, View v, int position,
                long id) {
            if (position == 5) {
                Intent intent = new Intent(Intent.ACTION_VIEW);
                Uri uri = Uri.parse(href2_final
                                + "=service&doc_library=ABN01&doc_number="
                                + record_parsed_final
                                + "&line_number=0001&func_code=WEB-FULL&service_type=MEDIA");
                intent.setData(uri);
                startActivity(intent);
            }
        }
    });
What am I doing wrong? If I delete the IF statement then it will launch the web view when i press any item in the list.
Thanks!
 
     
     
    