Reputation: 115
I have a "has_groups_fragment" fragment, and it has an EditText element. When I try to click on it, the keyboard is not responding.
the layout is the following:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/has_groups"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ft_background"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/searchGroupsArea"
android:layout_width="350dp"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/inputGroupSearch"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_weight="0.86"
android:clickable="true"
android:ems="10"
android:hint="Search a group..."
android:inputType="textVisiblePassword"
android:textIsSelectable="true" >
<requestFocus />
</EditText>
<ImageView
android:id="@+id/magnifyingGlass"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="right"
android:src="@drawable/search_icon" />
</LinearLayout>
<ListView
android:id="@+id/groupsList"
android:layout_width="fill_parent"
android:layout_height="407dp"
android:layout_weight="1.52"
android:choiceMode="singleChoice" />
</LinearLayout>
Any advices? Thanks a lot!
Upvotes: 1
Views: 1019
Reputation: 16288
Try removing both android:clickable
and android:textIsSelectable
attributes
Upvotes: 0
Reputation: 8680
I think you might have forgotten to add this to your activity, in your AndroidManifest.xml file:
<activity android:name="your_activity_name"
...
android:windowSoftInputMode="adjustPan"
...>
Upvotes: 0
Reputation: 39201
I believe the following attribute is the problem:
android:textIsSelectable="true"
When this is set to true for an EditText
View
, it allows text in the EditText
to be selected, but it disallows editing of the text, which is why the keyboard doesn't show.
If you just want to allow normal copy/paste procedures, you don't need to set this.
Upvotes: 1