Layout XML Code

SQLiteDemo/app/src/main/res/layout/main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">

  <LinearLayout
      android:id="@+id/group"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content">

    <Button
        android:id="@+id/add"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Add New" 
        android:onClick="onClick" />

    <Button
        android:id="@+id/delete"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Delete First" 
        android:onClick="onClick" />
        
  </LinearLayout>

  <ListView
      android:id="@android:id/list"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content" />

</LinearLayout>
Line 18: android:onClick="onClick" />
It gives the name of the method onClick in this Botton’s context to invoke when the button is clicked. This name must correspond to a public method that takes exactly one parameter of type View.

Line 29: ListView
It is a view that shows items in a vertically scrolling list. The items come from the ListAdapter, which is the bridge between a ListView and the data that backs the list.