android - Starting an activity after a listview item is clicked? -


this question has answer here:

okay, have app few tutorials.(around 20) (each tut text filled in activity screen)

i want create button on main menu, points listview activity containing names of tutorial's activities - alphabetically.

not perfect navigation, know. think it's best quick , easy solution till learn more.

here's problem: want find out listview item clicked, , put normal onclick() opens corresponding tutorial activity.

how set listview ? know how normal onclick works... how listview item ?

i assuming using adapter load content in listview. add handler individual row.

    public view getview(int position, view convertview, viewgroup parent)      {     view v = convertview;              // create row layout     if (v == null) {         layoutinflater vi = (  layoutinflater)getcontext().getsystemservice(context.layout_inflater_service);         v = vi.inflate(r.layout.your_layout,  parent, false);     }               // set click listener , handle     v.setonclicklistener(new onclicklistener() {          @override         public void onclick(view arg0) {             // todo auto-generated method stub          }      });      } 

Comments