0

Spinner drop down list cannot selected in Frame layout. Here is the code. Thank you in advance for your help.

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

    <TabHost
        android:id="@+id/tab_host"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <Spinner
                    android:id="@+id/ddlSsid"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginStart="50dp" />

                <include layout="@layout/information" />

                <include layout="@layout/network" />

                <include layout="@layout/ping_ip_setting" />

                <include layout="@layout/scan_information" />
            </FrameLayout>
        </LinearLayout>
    </TabHost>
</LinearLayout>

It is OK if spinner set outside FrameLayout. Thanks you very much for all help :)

pes
  • 13
  • 4

1 Answers1

-1

Kindly replace this line in Frame layout,

 android:id="@android:id/tabcontent"

with this,

 android:id="@+id/tabcontent"
Vishal Yadav
  • 3,642
  • 3
  • 25
  • 42
Vishal Vaishnav
  • 3,346
  • 3
  • 26
  • 57
  • Thanks for help. But Exception has occurred. "Caused by: java.lang.RuntimeException: Your TabHost must have a FrameLayout whose id attribute is 'android.R.id.tabcontent'" – pes Jun 30 '17 at 07:03
  • @pes Check this - [stackoverflow.com/questions/8538437](https://stackoverflow.com/questions/8538437/your-content-must-have-a-tabhost-whose-id-attribute-is-android-r-id-tabhost) – Vishal Yadav Jun 30 '17 at 07:17
  • I solved the problem. Because my included layout had Scroll View so Spinner conflicted. When remove Scroll View Spinner can selected. Thanks for your help. – pes Jun 30 '17 at 07:24