0

I am looking for a better way of clicking, i have a lazy list that i am working on but for some reason i can only make the entire list per list line to be clickable and i would like to make different items in that list to be clickable per line lets say i have three pictures or two pictures in one line of the lazy list and make each of those clickable. right now am using this but it only makes my list clickable per line only

public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                long arg3) {
             switch (arg2)
             {
                case 0:
                 Intent newActivity0 = new Intent(AmainActivityFractals.this,FractalsTwoOne.class);     
                 startActivity(newActivity0);
                break;
                case 1:
                 Intent newActivity1 = new Intent(AmainActivityFractals.this,FractalsTwoTwo.class);     
                 startActivity(newActivity1);
                break;

does someone know a better aproach? thank you

user1385487
  • 65
  • 1
  • 9

1 Answers1

1

Very similar question here.

Basically add the onClickListeners() for your buttons to your list adapter when you're inflating the list item Views.

Community
  • 1
  • 1
jmhend
  • 537
  • 1
  • 6
  • 16
  • how can i do do that if i may ask? – user1385487 Jun 01 '12 at 14:21
  • 1
    In the question I provided, an answer links to http://www.geekmind.net/2009/11/android-custom-list-item-with-nested.html, which has a step-by-step walkthrough of it. If you're not already, you'll need to create your on `BaseAdapter` (or similarly `ArrayAdapter<>` or `CursorAdapter` to use this method). – jmhend Jun 01 '12 at 14:52