Look Inside Yourself
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
Then, change it to be a ListActivity instead of an ordinary Activity, as we
will be using some ListActivity-specific methods and support in this
tutorial.
Step #2: Create a Layout
The goal of Contacter is to allow you to choose a contact, then show a list of
possible actions on that contact via a ListView. That means we need a layout
that lets us accomplish those ends.
With that in mind, create Contacter/res/layout/main.xml with the following
content:
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
android:id="@+id/pick"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Gimme a contact!"
android:layout_weight="1"
/>
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
/>
306
Subscribe to updates at http://commonsware.com
Special Creative Commons BY-NC-SA 3.0 License Edition
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
Then, change it to be a ListActivity instead of an ordinary Activity, as we
will be using some ListActivity-specific methods and support in this
tutorial.
Step #2: Create a Layout
The goal of Contacter is to allow you to choose a contact, then show a list of
possible actions on that contact via a ListView. That means we need a layout
that lets us accomplish those ends.
With that in mind, create Contacter/res/layout/main.xml with the following
content:
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
android:id="@+id/pick"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Gimme a contact!"
android:layout_weight="1"
/>
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
/>
306
Subscribe to updates at http://commonsware.com
Special Creative Commons BY-NC-SA 3.0 License Edition
