我当前的代码: ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item, array_spinner);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
c
我已经开始学习Android开发,并正在从以下一本书todolist的例子: // Create the array list of to do items
final ArrayList<String> todoItems = new ArrayList<String>();
// Create the array adapter to bind the array to the list
我有一个奇怪的问题。我有一个ArrayAdapter,我正在排序。这显示在我的屏幕上,但是当我检查实际的数据源时,内容尚未排序。我怎样才能确保排序我的ListAdapter也将我的数据源排序? Collections.sort(quotes, new PercentChangeComparator()); //sort my data source (this isn't necessary)
好吧,所以我有一个数组适应listview(数组适配是在另一个类中完成)..我只是得到了点击监听器为列表工作,但现在我想要设置它,以便当我点击一个项目时,它从被点击的项目中抽取字符串,并将它们附加到新活动的意图上。我想我应该使用intent.putextra但是我不知道如何拉正确的字符串对应于我点击..我的代码是下面的项..即时通讯只是失去了诚实 //Initialize the ListView