How to Create an ArrayAdapter

ArrayAdapter: Added in API level 1

1. If you don't already have an Android project, create a new project. 

2. In the MainActivity.java file, add the below line to the imports section.

import android.widget.ArrayAdapter;

3. In the MainActivity.java file, add the below line in the onCreate method.

    ArrayAdapter<String> myArrayAdapter;

4. Compile and run!

Previous Recommended Article: How to Create a String Array

Resources: