Sikander Bhutto
Sikander Bhutto

Reputation: 226

I have a AutoCompleteTextView and want to set single value

<AutoCompleteTextView
                android:id="@+id/step1_textview_area"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:layout_weight="0"
                android:background="@drawable/edittext_round_corner_borders"
                android:paddingLeft="5dp"
                android:ems="10" />

Using below code to set text

areaAutoCompleteTextView.setText(objPropertyObject.getArea());

but it's not wokring

Upvotes: 0

Views: 1093

Answers (1)

Burak iren
Burak iren

Reputation: 336

Can you try this code in your activity?

step1_textview_area.postDelayed(new Runnable() {
        @Override
        public void run() {
            step1_textview_area.showDropDown();
        }
    },500);
    step1_textview_area.setText(objPropertyObject.getArea());
    step1_textview_area.setSelection(autoText.getText().length());

Upvotes: 1

Related Questions