public override void OnActivityCreated(Bundle savedInstanceState) { base.OnActivityCreated(savedInstanceState); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this.Activity); bookListView.SetLayoutManager(layoutManager); var adapter = new MyBooksAdapter(Context, books, bookListView); bookListView.SetAdapter(adapter); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.booksList); ListView bookListView = FindViewById <ListView>(Resource.Id.bookListView); List <Book> books = new List <Book>(); Book book1 = new Book("111111111", "Balta droble", "Antanas Skema", DateTime.Parse("1962-09-01")); Book book2 = new Book("111111112", "Metai", "Danelaitis", DateTime.Parse("1922-09-01")); Book book3 = new Book("111111113", "Metai", "Danelaitis", DateTime.Parse("1922-09-01")); books.Add(book1); books.Add(book2); books.Add(book3); var adapter = new MyBooksAdapter(this, books); bookListView.Adapter = adapter; //PopulateList(); }