示例#1
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.VocabList);
			lvvocabs = FindViewById<ListView> (Resource.Id.listViewVocabs);

			Note note1 = new Note ("front 1", "back 1");
			Note note2 = new Note ("front 2", "back 2");
			List<Note> notes = new List<Note>{ note1, note2 };

			vocabs = new List<Vocab>();
			vocabs.Add(new Vocab(notes) { name = "James Bond", author = "Sherlock Holmes" });
			// get vocabs from DB

			//ArrayAdapter<Vocab> adapter = new ArrayAdapter(this, FindViewById<Vocab>(Resource.Id.listViewVocabs));
			VocabListAdapter adapter = new VocabListAdapter(this, vocabs);
			lvvocabs.Adapter = adapter;
		}
示例#2
0
		public void Add(Note n) 
		{
			Notes.Add(n);
		}