Custom Views and Adapters

A basic Introduction

Created by Saksham Agarwal / Piyush Bhopalka

Let's start with a video

That's implementing the ArrayAdapter.

Here's the code for reference. Link

Attaching ArrayAdapter to ListView

Writing in the MainActivity.java
Inside the onCreate() function


ListView listView = new ListView(this);

listView.setAdapter(new MyContactsArrayAdapter(MainActivity.this, contacts_list));

setContentView(listView);
        

Implementing Cursor-Adapters

Content Providers

That's implementing the CursorAdapter.

Here's the code for reference. Link

THE END

- That's it for Week 2
- We finished off with Views, Custom Views.
- This knowledge is sufficient for building apps that don't use databases or internet
- For deeper understanding, go through the Udacity Course or the Android Developer Website.
- Next session we will learn to use internet and connect apps to cloud

Back to Home page