Arrayadapter (Array adapter): Used to bind single-frame data. Data source: Can be a collection or an array
public class Mainactivity extends appcompatactivity { private ListView lv; Private arrayadapter<string> Arr_adapter; @Override protected void onCreate (Bundle savedinstancestate) { super.oncreate (savedinstancestate); Setcontentview (r.layout.activity_main); LV = (ListView) Findviewbyid (R.id.listview); String[] Array_data = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday"}; 1. Create a new adapter //arraydapter (context, each load list item corresponding to the layout file, data source,) // 2. Adapter Load Data source Arr_adapter = new Arrayadapter<string> (this,android. R.layout.simple_list_item_1,array_data); Android comes with a layout file to be aware of first Android. R. 3. View ListView Load Adapter lv.setadapter (arr_adapter);} }
Adapter 1, Arrayadapter 2.SimpleAdapter