how to disable item click for particular positions in grid view in android
<p>i am using a grid view in which  i am using a text view for each cell. i am using onitemclick to perform some action when clicked on grid cell. i want to disable on item click for particular positions in grid view. how do i do that. i used convertView.setclickable(false) for particular position in getView which is giving null pointer exception. How do i do that?? here s my code.</p>

<pre><code>@Override
public View getView(int position, View convertView, ViewGroup parent) {
  if (convertView == null) {
    textView = new TextView(context);
    textView.setLayoutParams(new GridView.LayoutParams(35, 35));
  } else {
    textView = (TextView) convertView;
  }

        textView.setTextSize(10);
        day_color = list.get(position).split("-");
        textView.setText(day_color[0]);

        if (day_color[1].equals("GREY")) {
            textView.setTextColor(Color.LTGRAY);
            //greyvalues.get(position)CalendarEvents
            convertView.setClickable(false);

        }
        if (day_color[1].equals("BLACK")) {
            textView.setTextColor(Color.BLACK);
        }
        if ((day_color[1].equals("BLUE"))) {
            textView.setTextColor(Color.RED);
        }

        setColor = Color.TRANSPARENT;
        if (position &gt;= startPos &amp;&amp; position &lt;= endPos
                &amp;&amp; selectdayselected != true) {
            setColor = Color.DKGRAY;
        }
        if (startPos == position &amp;&amp; selectdayselected == true)
            setColor = Color.DKGRAY;
        textView.setBackgroundColor(setColor);


        return textView;
    }
</code></pre>
