tanlocle0495 / android-section-list

Automatically exported from code.google.com/p/android-section-list
Other
0 stars 0 forks source link

onItemClickListener only called for sections #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When I click add an onItemClickListener ass below, it will only get called if 
it's a section being clicked, not if it is a regular row.

Does anyone know how to fix this?

// Create and set adapter
        this.arrayAdapter = new StandardArrayAdapter(this, R.id.artists_list_view_title, this.sectionListItems);
        this.sectionAdapter = new SectionListAdapter(getLayoutInflater(), this.arrayAdapter);
        this.listView = (SectionListView) findViewById(R.id.artists_list_view);
        this.listView.setAdapter(this.sectionAdapter);

        //
        this.sectionAdapter.setOnItemClickListener(new OnItemClickListener()
        {
            @Override
            public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
                Log.d(LOG_TAG, "Clicked.");
            }
        });
        this.listView.setOnItemClickListener(this.sectionAdapter);

Original issue reported on code.google.com by simonsto...@gmail.com on 28 Jan 2012 at 7:32

GoogleCodeExporter commented 8 years ago
Sorry, I was not clear in my question. The onItemClick() method in the question 
above will never be called. onItemClick() in SectionListAdapter will be called 
but only when it's a section being clicked.

Original comment by simonsto...@gmail.com on 28 Jan 2012 at 7:35

GoogleCodeExporter commented 8 years ago
Look at issue#3. It might help you to understand what the problem is. You have 
- most likely - other clickable elements in your view which do not pass through 
onclicks.

Original comment by jarek.po...@polidea.pl on 28 Jan 2012 at 10:01