• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps MultiAutoCompleteTextView two and more lines don't show

Hi, guys!
I use MultiAutoCompleteTextView to get any data from user.
If user enter more that two elements MultiAutoCompleteTextView don't change his size, so I don't see first row.

How to make, that MultiAutoCompleteTextView automatic change his size?
two elements:
img2_mod_240.jpg

Entering three elements:
img3_mod_240.jpg

All elements do not show :mad:
last_mod_240.jpg

Code:
        @Override
            public void doClickAction(View v) {
	        	LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
	        	layoutDialogUserList = inflater.inflate(R.layout.dialog_user_list_autocomplete, (ViewGroup) findViewById(R.id.layout_user_list));

	        	dialogUserList = new Dialog(GroupsAddGroupActivity.this);
	        	dialogUserList.requestWindowFeature(Window.FEATURE_NO_TITLE);
	        	dialogUserList.setContentView(layoutDialogUserList);

	        	Button buttonOk = (Button) layoutDialogUserList.findViewById(R.id.ok);
	        	buttonOk.setOnClickListener(new OnClickListener() {
	                public void onClick(View v)
	                {
	                	MultiAutoCompleteTextView textView = (MultiAutoCompleteTextView) layoutDialogUserList.findViewById(R.id.friends);
	                   	textView.setThreshold(1);
	                	stringUsersInGroup = textView.getText().toString();
	                	fillUsersAdapter();
	                	dialogUserList.dismiss();
	                }
	            } );

	        	Button buttonCancel = (Button) layoutDialogUserList.findViewById(R.id.cancel);
	        	buttonCancel.setOnClickListener(new OnClickListener() {
	                public void onClick(View v)
	                {
	                	dialogUserList.dismiss();	                	
	                }
	            } );

	        	dialogUserList.show();

	        	ContentResolver content = getContentResolver();
	        	ContactPeer fp = new ContactPeer(mContext);

	        	String[] friends_names = fp.getAllFriendsNamesArray(sortby);
	        	
	            ArrayAdapter<String> adapter = new ArrayAdapter<String>(mContext,
	                    android.R.layout.simple_dropdown_item_1line, friends_names);
	            MultiAutoCompleteTextView textView = (MultiAutoCompleteTextView) layoutDialogUserList.findViewById(R.id.friends);
	            textView.setText(stringUsersInGroup);
	            textView.setAdapter(adapter);
	            textView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());        	
            }
        });

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/layout_user_list"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:paddingLeft="10dip"
    android:paddingRight="10dip">
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/caption_add_user"
        android:layout_marginBottom="5dip"
        android:gravity="center_horizontal"
        style="@style/captions_dark"
        />
    <MultiAutoCompleteTextView android:id="@+id/friends"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        />
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_margin="10dip"
        >
        <Button android:id="@+id/ok"
            android:layout_width="80dip"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dip"
            android:layout_gravity="left"
            style="@style/large_bold_black_text"
            android:text="Ok"
        />
        <Button android:id="@+id/cancel"
            android:layout_width="80dip"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dip"
            android:layout_gravity="right"
            style="@style/large_bold_black_text"
            android:text="Cancel"
        />
    </LinearLayout>
</LinearLayout>
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones