Inheritance: android.widget.BaseAdapter, Filterable
Esempio n. 1
0
		protected override void onCreate (android.os.Bundle savedInstanceState)
		{
			base.onCreate (savedInstanceState);

			var res = getResources();
			var lemurs = res.getStringArray (R.array.lemur_string_array);

			var adapter = new ArrayAdapter<string> (
				this, android.R.layout.simple_list_item_1, lemurs);
			setListAdapter (adapter);
		}
        private void getDir(string dirPath)
        {
            myPath.setText("Location: " + dirPath);
            item = new ArrayList();
            path = new ArrayList();
            File f = new File(dirPath);
            File[] files = f.listFiles();

            //if (!(root.StringEquals(dirPath)))
            //if (root != dirPath)
            {
                item.add(root);
                path.add(root);
                item.add("../");
                path.add(f.getParent());
            }


            if (files != null)
                for (int i = 0; i < files.Length; i++)
                {
                    File file = files[i];

                    if (!file.isHidden() && file.canRead())
                    {
                        path.add(file.getPath());
                        if (file.isDirectory())
                        {
                            item.add(file.getName() + "/");
                        }
                        else
                        {
                            item.add(file.getName());
                        }
                    }
                }

            var fileList =
              new ArrayAdapter(this, R.layout.row, item);
            //new ArrayAdapter<String>(this, R.layout.row, item);
            setListAdapter(fileList);
        }