I'm totally new to android programming, I'm trying to create a friendslist class.
First, I make an array that loads objects from a database:
friendArray = new Friend[NumberOfFriendsInDatabase];
//gets friend objects from the database, and loads them into an array
for (int i=0;i<NumberOfFriendsInDatabase;i++){
friendArray[i]=new Friend("","","");//swap this with an object or data from database handler.
then I create a listview where I want the array to be visually represented:
friendListView =(ListView) findViewById(R.id.FriendsListView1);
and at last, I understand that I need to use an adapter to achieve this, and this is where I'm confused.
friendListAdapter = ArrayAdapter();
I'm having trouble creating the adapter, and I can't make sense of the official documentation. All I want is the friendArray in an adapter that I can use with listView.