目的是为了清除TextView的焦点,单纯clearFocus的话是没有效果的,首先在TextView的父布局上设置 :
android:focusable="true"
android:focusableInTouchMode="true"
<RelativeLayout
android:id="@+id/relativelayout_contact_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/contact_wireless_item_layout_margin_top"
android:focusable="true"
android:focusableInTouchMode="true">
<TextView
android:id="@+id/contact_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginStart="&