0

我试图从我的数据库中获取微调器的数据台,但它没有出现;这是我在微调器中设置项目的代码;

protected void onPostExecute(String file_url) {
    // dismiss the progress dialog after getting all desk
    pDialog.dismiss();
    // updating UI from Background Thread
    runOnUiThread(new Runnable() {
        public void run() {
            // Get desk
            for (int i = 0; i < nodes.getLength(); i++) {
                HashMap<String, String> map = new HashMap<String, String>);
                Element e = (Element) nodes.item(i);

                map.put("desk", parser.getValue(e, "desk"));
                mylist.add(map);
            }
            // Adding myList to ListView
            ArrayAdapter adapter = new ArrayAdapter(MainActivity.this,android.R.layout.simple_spinner_item,new String[] { "desk" });
            s.setAdapter(adapter);
        }
    });

当我尝试运行它时,它只desk在数据库中不显示我的数据,我的代码有问题吗?

4

1 回答 1

1
ArrayAdapter<String> adapter = new ArrayAdapter<String>(MainActivity.this,android.R.layout.simple_spinner_item ,mylist);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);                 
s.setAdapter(adapter);
于 2013-07-30T02:49:57.240 回答