0
目前我正在使用android開發社交媒體應用程序。在這個應用程序中,我希望允許用戶提及對方(如在twitter,fb,instagram等中)。我試圖使用AutoCompleteTextView。但是,它只顯示第一個單詞的建議,而不是下一個單詞。用於提醒人們的Android AutoCompleteTextView
例如,在當前系統中: 如果我爲第一個單詞鍵入:「@ab」,則會顯示建議列表。但是,當我輸入:「嗨,@ab」時,它不會顯示任何建議。
任何人都知道如何解決這個問題,並提供一些例子?這裏是我在我的應用程序創建AutoCompleteTextVIew:
AutoCompleteTextView et_comment = new AutoCompleteTextView(context);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(context,
android.R.layout.simple_dropdown_item_1line, user_follow);
et_comment.setAdapter(adapter);
非常感謝。
使用'MultiAutoCompleteTextView'代替AutoCompleteTextView並設置'setTokenizer(新MultiAutoCompleteTextView.CommaTokenizer());' – Rustam 2014-11-09 07:00:59