Java 帮助按钮自动完成

Java 帮助按钮自动完成,java,android,android-layout,autocomplete,autocompletetextview,Java,Android,Android Layout,Autocomplete,Autocompletetextview,这是我的布局与自动完成和5个按钮。按钮中的文本是从活动类设置的。 用于填充以使用字符串数组自动完成im。从“活动”手动填充按钮中的文本。现在,这场比赛会持续多久才开始?在emulator中,autocomplete无法对其进行测试 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layou

这是我的布局与自动完成和5个按钮。按钮中的文本是从活动类设置的。
用于填充以使用字符串数组自动完成im。从“活动”手动填充按钮中的文本。现在,这场比赛会持续多久才开始?在emulator中,autocomplete无法对其进行测试

<?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:background="@android:color/white"
android:gravity="center_horizontal"
android:orientation="vertical" >

<AutoCompleteTextView
    android:id="@+id/autoCompleteTextView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight=".16"
    android:ems="10"
    android:text="Rule" >

    <requestFocus />
</AutoCompleteTextView>

<LinearLayout style="@style/verticallayout" >

    <LinearLayout style="@style/verticallayout" >

        <Button
            android:id="@+id/b1"
            style="@style/buttons"
            android:layout_weight=".16"
           />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/ll41"
        style="@style/horizontallayouthidden" >

        <TextView
            android:id="@+id/t1"
            style="@style/textview"
            android:layout_weight="0.5" />

        <TextView
            android:id="@+id/tt1"
            style="@style/textview"
            android:layout_weight="0.5" />
    </LinearLayout>
</LinearLayout>

<LinearLayout style="@style/verticallayout" >

    <LinearLayout style="@style/verticallayout" >

        <Button
            android:id="@+id/b2"
            style="@style/buttons"
            android:layout_weight=".16"/>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/ll42"
        style="@style/horizontallayouthidden" >

        <TextView
            android:id="@+id/t2"
            style="@style/textview"
            android:layout_weight="0.5" />

        <TextView
            android:id="@+id/tt2"
            style="@style/textview"
            android:layout_weight="0.5" />
    </LinearLayout>
</LinearLayout>

<LinearLayout style="@style/verticallayout" >

    <LinearLayout style="@style/verticallayout" >

        <Button
            android:id="@+id/b3"
            style="@style/buttons"
            android:layout_weight=".16"/>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/ll43"
        style="@style/horizontallayouthidden" >

        <TextView
            android:id="@+id/t3"
            style="@style/textview"
            android:layout_weight="0.5" />

        <TextView
            android:id="@+id/tt3"
            style="@style/textview"
            android:layout_weight="0.5" />
    </LinearLayout>
</LinearLayout>

<LinearLayout style="@style/verticallayout" >

    <LinearLayout style="@style/verticallayout" >

        <Button
            android:id="@+id/b4"
            style="@style/buttons"
            android:layout_weight=".16"/>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/ll44"
        style="@style/horizontallayouthidden" >

        <TextView
            android:id="@+id/t4"
            style="@style/textview"
            android:layout_weight="0.5" />

        <TextView
            android:id="@+id/tt4"
            style="@style/textview"
            android:layout_weight="0.5" />
    </LinearLayout>
</LinearLayout>

<LinearLayout style="@style/verticallayout" >

    <LinearLayout style="@style/verticallayout" >

        <Button
            android:id="@+id/b5"
            style="@style/buttons"
            android:layout_weight=".16"/>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/ll45"
        style="@style/horizontallayouthidden" >

        <TextView
            android:id="@+id/t5"
            style="@style/textview"
            android:layout_weight="0.5" />

        <TextView
            android:id="@+id/tt5"
            style="@style/textview"
            android:layout_weight="0.5" />
    </LinearLayout>
</LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <Button
        android:id="@+id/left"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_weight="0.5"
        android:enabled="false"
        android:text="Prev" />

    <Button
        android:id="@+id/right"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_weight="0.5"
        android:text="Next" />
</LinearLayout>


如何设置我的活动类别b,以便当我在“自动完成”中键入名称时,填充带有该文本的按钮,并且所有按钮功能将继续工作。

您必须设置条件并仅使用button.setVisibility(View.GONE)和button.setVisibility(View.VISIBLE);根据您的要求,自动折叠按钮是否也适用?它也会从按钮中srch吗?不,并没有默认属性,但你们可以自定义这个属性,当然可以使用字符串数组填充来自动完成im。从“活动”手动填充按钮中的文本。现在,这场比赛会持续多久才开始?在emulator中,autocomplete无法对其进行测试。它也可以在emulator上运行,因此请记录您遇到的错误