下拉项目android无法正常工作

时间:2016-09-06 17:01:11

标签: android

我有这段代码:

db.collection('products').find({'recommendaionByCategory.categoryId': categoryId}).sort({'recommendationByCategory.recommendation: 1'})

editText1 =应用中的edittext Cities =下拉列表的字符串数组

但是第二行给了我一个错误,我该如何解决?

2 个答案:

答案 0 :(得分:0)

将EditText更改为上述活动的XML布局文件中的AutoCompleteTextView。

答案 1 :(得分:0)

您应该在xml中使用editText而不是“AutoCompleteTextView”。

<AutoCompleteTextView
      android:id="@+id/myAutoCompleteTextView"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="54dp"
      android:ems="10" />

更改
AutoCompleteTextView textedit =(AutoCompleteTextView) findViewById(R.id.myAutoCompleteTextView);
相关问题