Step 1 Create an Android project with Empty Activity. ArrayAdapter ad new ArrayAdapter (itemView.getContext (),android.R.layout.simplespinneritem, courses) Your're declaring ArrayAdapter in ViewHolder, not in Activity, so this keyword should not use here. The complete project structure with the file locations is as shown in the following screenshot. Package import import android.os.Bundle import import .CoordinatorLayout import .Snackbar import 7.app.AppCompatActivity import 7.widget.RecyclerView import 7. The following is a step by step process to display items in a RecyclerView widget. In the MainActivity.java file, we will write the below code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |