ListView only appears when I click to close the keyboard [closed]

1

I do not know how to solve this problem, but the list-view does not appear when I search, it only comes to appear when I click the button to close the keyboard, it seems that when I press the button it updates the Activity and there it appears a lot strange.

Below are images with the problem.

Att Cristiano.

Code

<RelativeLayoutandroid:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/wallpaper"
    android:windowSoftInputMode="adjustPan">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentEnd="true"
        android:layout_alignParentTop="true"
        android:windowSoftInputMode="adjustPan">

        <TextView
            android:id="@+id/textView10"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="20dp"
            android:text="O que você está procurando?"
            android:textColor="#fb7b03"
            android:textSize="22dp" />

        <EditText
            android:id="@+id/edtBusca"
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:layout_alignParentStart="true"
            android:layout_below="@+id/textView10"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="48dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/editstyle"
            android:inputType="textCapSentences" />

        <ImageView
            android:id="@+id/imgprocurar"
            android:layout_width="40dp"
            android:layout_height="30dp"
            android:layout_alignParentEnd="true"
            android:layout_alignTop="@+id/edtBusca"
            android:layout_marginRight="10dp"
            android:background="#00ffffff"
            android:src="@drawable/procurar" />

        <Spinner
            android:id="@+id/spnOrdenar"
            android:layout_width="fill_parent"
            android:layout_height="35dp"
            android:layout_alignParentStart="true"
            android:layout_alignWithParentIfMissing="false"
            android:layout_below="@+id/textView11"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/editstyle"
            android:gravity="center" />

        <TextView
            android:id="@+id/textView11"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/edtBusca"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="10dp"
            android:text="Organizar por:"
            android:textColor="#fb7b03"
            android:textSize="18dp" />

        <ListView
            android:id="@+id/listViewProdutos"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_below="@+id/spnOrdenar"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp" />

        <ImageView
            android:id="@+id/imglimpar"
            android:layout_width="40dp"
            android:layout_height="30dp"
            android:layout_above="@+id/textView11"
            android:layout_alignParentEnd="true"
            android:layout_marginRight="10dp"
            android:src="@drawable/canpesq" />

    </RelativeLayout>
</RelativeLayout>

<ListView
    android:id="@+id/lv_sliding_menu"
    android:layout_width="200dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:background="#FFFFFF"
    android:choiceMode="singleChoice"></ListView>

    
asked by anonymous 21.10.2016 / 05:58

1 answer

0

Try closing the keyboard via code when the search view is finished

getWindow().setSoftInputMode(
    WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN
);
    
21.10.2016 / 14:13