View.setFocusable() and View.setClickable() have contrary effect in custom ArrayAdapter
<p>This is a follow up to this <a href="http://stackoverflow.com/questions/2183610/android-how-to-disable-list-items-on-list-creation/">question</a> where <a href="http://stackoverflow.com/users/665083/reimar-twelker">Reimar Twelker</a> suggested using <code>View.setFocusable()</code> and <code>View.setClickable()</code> to enable/disable rows in a list view using an ArrayAdapter.</p>

<p>I tried doing this, but I get the opposite effect to what I would expect.
If I use </p>

<pre><code>View.setFocusable(true);
View.setClickable(true);
</code></pre>

<p>the row is disabled (no effect when I press it). And if I use the opposite:</p>

<pre><code>View.setFocusable(false);
View.setClickable(false);
</code></pre>

<p>the row is enabled (selection applied when I press it).</p>

<p>Any clue about what might be happening?</p>

<p>Here is the contents of my layout:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/row_style"
  android:layout_width="fill_parent"
  android:layout_height="?android:attr/listPreferredItemHeight" 
  android:paddingLeft="5dip"
  android:paddingRight="5dip"&gt;

  &lt;ImageView android:id="@+id/row_image_style"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:adjustViewBounds="false"
    android:scaleType="centerCrop"
    android:drawingCacheQuality="low" /&gt;
&lt;/FrameLayout&gt;
</code></pre>

<p>I use it in an alert dialog like this:</p>

<pre><code>dialog = new AlertDialog.Builder(this)
            .setTitle(R.string.templates_dialog)
            .setAdapter(new StyleAdapter(this, R.id.row_style, StyleTemplate.values()), 
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        setTemplate(StyleTemplate.values()[which]);
                    }
                })
            .create();
            dialog.setCanceledOnTouchOutside(true);
</code></pre>

<p>and <code>StyleAdapter</code> is defined as follows:</p>

<pre><code>public class StyleAdapter extends ArrayAdapter&lt;StyleTemplate&gt;{

        private final StyleTemplate[] m_objects;
        private final LayoutInflater inflater;

        public StyleAdapter(Context context, int textViewResourceId, StyleTemplate[] objects) {
            super(context, textViewResourceId, objects);
            m_objects = objects;
            inflater = getLayoutInflater();
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View row = convertView;
            if (row == null) { // Reuse the old view if it exists
                row = inflater.inflate(R.layout.row_style, parent, false);
            }

            // Get the selected style data
            StyleTemplate style = m_objects[position];

            // Set the background image to the template background
            ImageView bg = (ImageView) row.findViewById(R.id.row_image_style);
            bg.setImageDrawable(null);
            bg.setBackgroundColor(Color.rgb(style.bR, style.bG, style.bB));

            boolean val = true;
            row.setFocusable(val);
            row.setClickable(val);

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

<p>To test the effect of <code>setFocusable()</code> and <code>setClickable()</code>, I simply change the value of <code>val</code> in <code>StyleAdapter.getView()</code>.</p>
