0

i am newbie to android and working on searchView controll in android,I have put a searchView in my activity and my issue is when i am performing any action my keyboard open because of my searchView opened by default,Can anyone tell me how to make my serachView close by default when myy activity starts?my code is as below:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

  <SearchView
        android:id="@+id/searchViewSearchPosts"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"


        android:layout_alignParentTop="true"
      android:showAsAction="collapseActionView|ifRoom"
        android:iconifiedByDefault="true"
        android:queryHint="Search.." >

    </SearchView>

       <FrameLayout
            android:id="@+id/fragmentTimeline"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentBottom="true"

            android:layout_marginTop="0dp" />

</LinearLayout>

manifest.xml

<activity
            android:name="one.tusk.stush.SearchPostActivity"
            android:parentActivityName="one.tusk.stush.activities.MainActivity"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="stateHidden|adjustNothing"
            android:label="Back">
            >
        </activity>
sulphuric Acid
  • 545
  • 5
  • 22
  • Add the following line to your activity entry in `AndroidManifest.xml` android:windowSoftInputMode="stateHidden|adjustNothing" – Clinkz Mar 18 '16 at 05:53
  • @Clinkz - Nothing happened..:( – sulphuric Acid Mar 18 '16 at 06:48
  • I find that hard to believe. With the `SoftInputMode` set, the VKB doesn't come up automatically. Can you post your AndroidManifest also please? – Clinkz Mar 18 '16 at 07:08
  • @Clinkz -sure brother.pls wait 2mins – sulphuric Acid Mar 18 '16 at 07:18
  • @Clinkz - pls see my edit. – sulphuric Acid Mar 18 '16 at 07:19
  • I can't recreate the problem. VKB never opens up by default. I don't think I'll be of much help to you. Refer the following links [link 1](http://stackoverflow.com/questions/1109022/close-hide-the-android-soft-keyboard?rq=1) [link 2](http://stackoverflow.com/questions/18957396/how-to-hide-android-keyboard-in-search-view?rq=1) – Clinkz Mar 18 '16 at 07:31

0 Answers0