0

This is my Layout with autocomplete and 5 buttons. The text in the buttons is set from activity class. For populating to autocomplete im using String Array. The text in Buttons im populating manually from activity. Now would the match take and come to existance? In emulator the autocomplete is not working to test it.

<?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>

how shd my activity class b such that when i type in the name in autocomplete the button with that text be populated and all the button functionality would continue to work on..

Sekhar
  • 21
  • 7
  • you'll have to put condition and just use button.setVisibility(View.GONE)and button.setVisibility(View.VISIBLE); as per your requirement. – Dilip Jan 25 '13 at 06:28
  • would the autocomeplete work in buttons also? would it srch in from buttons also? – Sekhar Jan 25 '13 at 06:45
  • no there is not default property but u can customised this ofcourse – Dilip Jan 25 '13 at 06:47
  • For populating to autocomplete im using String Array. The text in Buttons im populating manually from activity. Now would the match take and come to existance? In emulator the autocomplete is not working to test it. – Sekhar Jan 25 '13 at 06:47
  • it works on emulator also so please there logcat what error u r getting – Dilip Jan 25 '13 at 06:51

0 Answers0