1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
public class SelectCateg extends ListActivity{
Category data[] = {};
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
data = Category.getCategs(SelectCateg.this);
// Si il n'y a aucune tâche ...
if (data == null) {
Dialog d = new Dialog(SelectCateg.this);
d.setTitle("Problem : no categrories could be found !");
d.show();
} else {
String titre[] = new String[data.length];
for (int i =0;i<data.length;i++){
titre[i] = data[i].getCateg();
}
setListAdapter(new ArrayAdapter<String>(SelectCateg.this,
android.R.layout.simple_list_item_1, titre));
}
...
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
... |
Partager