How do i get the value of the item selected in listview?

Posted by user357032 on Stack Overflow See other posts from Stack Overflow or by user357032
Published on 2010-06-03T01:44:09Z Indexed on 2010/06/03 1:54 UTC
Read the original article Hit count: 253

i thought i would use the position that i had int but when i click on the item in list view nothing happens. Please Help!!!!

ListView d = (ListView) findViewById(R.id.apo); ArrayAdapter adapt = ArrayAdapter.createFromResource( this, R.array.algebra, android.R.layout.simple_list_item_1); d.setAdapter(adapt); d.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View view, int position, long id) {

     if (position == '0'){
         Intent intent = new Intent(Algebra.this, Alqv.class);
            startActivity(intent);
     }
     if (position == '2'){
         Intent intent1 = new Intent(Algebra.this, qfs.class);
            startActivity(intent1);
     }

        }
      });

© Stack Overflow or respective owner

Related posts about android

Related posts about listview