The listView.adapter = myListAdapter set the return adapter to the ListView. In this class, we are creating two String array and one Int array to store string text and image id respectively.įrom this class, we are calling a custom adapter class named as MyListAdapter by passing the context and data as the parameters. At final stage you have to bind ListView. Now Add data in Array List and bind it with Adapter. Android SDK telah menyediakan beberapa font yaitu sans, serif, dan lainnya. For our example we are going to using activitymain.xml file. Also declare Array List of Bean and Adapter class as like I did. ListView listView (ListView) findViewById(R.id.listview) tAdapter(adapter) You will define your list view under res/layout directory in an XML file. Add the following code in the MainActivity.kt class. Once you have array adapter created, then simply call setAdapter() on your ListView object as follows.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |