I have an Activity, which has an EditText and a ListView. The EditText can be used to filter listview rows.
problem is that when the Activity loads up, the keyboard popups by default. I would want that the keyboard come up only when a user actualy taps into the text box and not by default.
Public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.filterablelayout);
filterText = (EditText) findViewById(R.id.search_box);
filterText.addTextChangedListener(filterTextWatcher);
filterText.setVisibility(View.INVISIBLE);
GetCategories();
}
My layout xml is as below:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/selectcat" />
<EditText
android:id="@+id/search_box"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/categorytxthint"
android:inputType="text"
android:maxLines="1" />
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1" />
</LinearLayout>