I have found some posts but none of the could help me with my problem;
So I have this code:
rowItems = new ArrayList<RowItem>();
location_names = new String[]{"Schule", "Büro", "Kirche", "Schule"};
location_longitude = new String[]{"12,23", "56,25", "55,14", "78,15"};
location_latitude = new String[]{"88,84", "88,79", "98,79", "64,44"};
switch_status = new String[]{"1", "0", "0", "0"};
for (int i = 0; i < location_names.length; i++){
RowItem item = new RowItem(location_names[i], locations_longitude[i], locations_latitude[i], on_off_switch_status[i]);
rowItems.add(item);
}
mylistview = (ListView) findViewById(R.id.list);
CustomAdapter adapter = new CustomAdapter(this, rowItems);
mylistview.setAdapter(adapter);
mylistview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent settings = new Intent(MainActivity.this, MapsActivity.class);
startActivity(settings);
}
});
The code is then displaying a listView with one item from each String[] in one Row.
This code works great, but I want to add an item to these String[].
I hope you can help me ;)
Phil