Time for action - creating the ListItemSelectionActivity

This is a fairly large and somewhat complex example to work through, so I'll break it into bite size chunks, each with a goal. The first thing we want is an Acitivity class with a nice looking layout. The layout we'll build is an EditText above a ListView, each one with an ID that can be used by the Acitivity.

  1. Create a new project to contain your ListItemSelectionActivity class:
    android create project -n Selector -p Selector -k com.packtpub.selector -a ListItemSelectionActivity -t 3
  2. Open the res/layout/main.xml file in an editor or IDE.
  3. Remove any of the default layout code.
  4. Ensure that the root element is a LinearLayout consuming the available screen space in the Activity:
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" ...

Get Android User Interface Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.