2013-04-09 74 views
0

我創建我自己的鍵盤,並使用mMultiAuto.setText將每個字母輸入MultiAutoCompleteTextView。我已經遵循所有的教程創建multiautocompletetextview下拉不顯示

mMultiAuto = (MultiAutoCompleteTextView)findViewById(R.id.multiautotextview); 
    adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, COUNTRIES); 
    mMultiAuto.setAdapter(adapter); 
    mMultiAuto.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer()); 

問題是,當我在textview中鍵入一個字母,下拉列表不顯示。誰能幫忙?

回答

3

與以下

mMultiAuto = (MultiAutoCompleteTextView)findViewById(R.id.multiautotextview); 
     adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, COUNTRIES); 
     mMultiAuto.setAdapter(adapter); 

          mMultiAuto.setThreshold(1); 

          mMultiAuto.setAdapter(soAdapter); 

          mMultiAuto.setOnTouchListener(new View.OnTouchListener() { 

           @Override 
           public boolean onTouch(View v, MotionEvent event) 
           { 
            mMultiAuto.showDropDown(); 
            return false; 
           } 
          }); 
替換代碼