How to avoid imagebutton in a listitem getting focused, when selecting a listitem?
<p>Help me to avoid getting Unnecessary focus. I disabled focus, but I don't know how it's getting focused. I suspect it's due to expandable listView or customadapter. thanks in advance.</p>

<pre><code>    ListDoctorsActivity.java

    public class ListDoctorsActivity extends ListActivity implements
        OnItemClickListener, OnClickListener {
    private ImageButton addUpdateButton;

    private DoctorAdapter doctorAdapter;
    private SimpleSectionAdapter&lt;Doctor&gt; sectionAdapter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.at_list_doctors);

        // UI References
        addUpdateButton = (ImageButton) findViewById(R.id.add_update);

        // Set listener
        addUpdateButton.setOnClickListener(this);
        getListView().setOnItemClickListener(this);
    }

    private class DoctorAdapter extends ArrayAdapter&lt;Doctor&gt; {
        // Attributes
        private List&lt;Doctor&gt; doctors;
        private int expandedViewPosition = -1;

        public DoctorAdapter(Context context, int textViewResourceId,
                List&lt;Doctor&gt; doctors) {
            super(context, textViewResourceId, doctors);
            this.doctors = doctors;

        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View view = convertView;
            Holder holder = null;

            if (view == null) {
                view = View.inflate(ListDoctorsActivity.this,
                        R.layout.at_list_item_doctor, null);

        holder = new Holder();
        holder.doctorNameTextView = (TextView) view
                        .findViewById(R.id.doctor_name);
        holder.specializationTextView = (TextView) view
                        .findViewById(R.id.specialization);
        holder.editImageButton = (ImageButton) view
                        .findViewById(R.id.edit);
        holder.expandableView =       view.findViewById(R.id.expandable_view);
        holder.callButton = (Button) view.findViewById(R.id.call);
        holder.emailButton = (Button) view.findViewById(R.id.email);
        holder.appointmentsButton = (Button) view
                        .findViewById(R.id.appointments);

                // Set properties
                holder.doctorNameTextView.setTypeface(headerTitleFont);

                view.setTag(holder);
            } else {
                holder = (Holder) view.getTag();
            }

            // Set properties
            final Doctor doctor = doctors.get(position);
            holder.doctorNameTextView.setText(doctor.getName());
            holder.specializationTextView.setText(doctor.getSpecialization());

            // Show / Hide the expandable view
            int visibility = position == expandedViewPosition ? View.VISIBLE
                    : View.GONE;
            holder.expandableView.setVisibility(visibility);
            // Event listeners
            OnClickListener clickListener = new OnClickListener() {

                @Override
                public void onClick(View v) {
                    switch (v.getId()) {
                    case R.id.edit:
                        edit(doctor);
                        break;
                    case R.id.call:
                        call(doctor);
                        break;
                    case R.id.email:
                        email(doctor);
                        break;
                    case R.id.appointments:
                        showAppointments(doctor);
                        break;
                    }
                }
            };

            holder.editImageButton.setOnClickListener(clickListener);
            holder.callButton.setOnClickListener(clickListener);
            holder.emailButton.setOnClickListener(clickListener);
            holder.appointmentsButton.setOnClickListener(clickListener);

            // Disable focus
            disableFocus(holder);

            return view;
        }

        private void disableFocus(Holder holder) {
            holder.editImageButton.setFocusable(false);
            holder.callButton.setFocusable(false);
            holder.emailButton.setFocusable(false);
            holder.appointmentsButton.setFocusable(false);
        }

        public void toggleExpandedView(int position) {
            expandedViewPosition = expandedViewPosition == position ? -1
                    : position;
            notifyDataSetChanged();
        }
    }

    static class Holder {
        public TextView doctorNameTextView;
        public TextView specializationTextView;
        public ImageButton editImageButton;
        public View expandableView;
        public Button callButton;
        public Button emailButton;
        public Button appointmentsButton;
    }

    class DoctorSectionizer implements Sectionizer&lt;Doctor&gt; {

        @Override
        public String getSectionTitleForItem(Doctor doctor) {
            return doctor.getName().toUpperCase().substring(0, 1);
        }
    }



    @Override
    protected void onStart() {
        super.onStart();
        // Model
        List&lt;Doctor&gt; doctors = Sorting(OrmanHelper.getDoctors());

        // Adapter
        doctorAdapter = new DoctorAdapter(this, R.layout.at_list_item_doctor,
                doctors);
        sectionAdapter = new SimpleSectionAdapter&lt;Doctor&gt;(this, doctorAdapter,
        R.layout.cmn_list_section, R.id.title, new   DoctorSectionizer());
        getListView().setAdapter(sectionAdapter);

    }

    @Override
    public void onItemClick(AdapterView&lt;?&gt; parentView, View view, int position,
            long id) {
        // Toggle list items
        int index = sectionAdapter.getIndexForPosition(position);
        doctorAdapter.toggleExpandedView(index);
        sectionAdapter.notifyDataSetChanged();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
        case R.id.add_update:
            Intent intent = new Intent(this, AddEditDoctorActivity.class);
            startActivity(intent);
            break;
        }
    }
    }
</code></pre>

<p>at_list_item_doctor.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:focusable="false" &gt;

    &lt;TextView
        android:id="@+id/doctor_name"
        style="@style/summary_text"
        android:layout_marginLeft="14dp"
        android:paddingTop="10dp"
        android:text="@string/name" /&gt;

    &lt;TextView
        android:id="@+id/specialization"
        style="@style/medium_text"
        android:layout_below="@+id/doctor_name"a
        android:layout_alignLeft="@id/doctor_name"
        android:paddingBottom="10dp"
        android:textColor="@color/gray_darkest"
        android:text="@string/specialization" /&gt;

    &lt;ImageButton
        android:id="@+id/edit"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@id/doctor_name"
        android:layout_alignBottom="@id/specialization"
        android:focusable="false"
        android:background="@android:color/transparent"
        android:src="@drawable/edit" /&gt;

    &lt;include
        android:id="@+id/expandable_view"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/specialization"
        android:visibility="gone"
        layout="@layout/at_list_item_expandable_doctor" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>
