0

I have recently implemented the StickyListHeadersListview library from github. Then I used MultiChoiceModeListener for selecting items and then to copy or delete those selected elements as seen below

I don't want the section headers (date field) to get highlighted. Is there any way to disable this behaviour.

This question originated from my last unanswered question. Refer the link for custom array adapter code

enter image description here

Community
  • 1
  • 1
gzix
  • 271
  • 3
  • 20
  • Did you tried changing the background color of `convetview` in the `getHeaderView()` method? – Emil Sep 30 '15 at 05:36
  • @Boss Haven't tried yet.. Thanks I'll try that – gzix Sep 30 '15 at 05:38
  • @Boss convertView.setBackground(Color.TRANSPARENT) did the trick.. can you please post it as an answer with explanation so that I can mark it as the accepted answer.. – gzix Sep 30 '15 at 07:42

1 Answers1

1

Change the background color of your view using View.setBackgroundColor(); method.

In your getHeaderView() method add this line

convertView.setBackgroundColor(your color)

  @Override
    public View getHeaderView(int position, View convertView, ViewGroup parent) {
        HeaderViewHolder holder;

        if (convertView == null) {
           holder = new HeaderViewHolder();
           convertView = mInflater.inflate(R.layout.date_separator, parent, false);

            convertView.setBackgroundColor(your color);// change here

         }                

         return convertView;
    }
Emil
  • 2,786
  • 20
  • 24
  • Why it is not getting highlighted after changing the colour.. It will be good if you explain that too – gzix Sep 30 '15 at 08:04