package app.test;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class Test extends ListActivity {
private String[] data = {};
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setListAdapter(new ArrayAdapter(this,
android.R.layout.simple_list_item_1, data));
}
protected void onListItemClick(ListView listView, View v, int position,
long id) {
super.onListItemClick(listView, v, position, id);
setTitle(listView.getItemAtPosition(position).toString());
}
}
//main.xml
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Empty"/>