Added clear button

This commit is contained in:
Ziver Koc 2014-08-19 17:56:12 +02:00
parent 6f1daa20ea
commit 9b407d2c94
3 changed files with 9 additions and 0 deletions

View file

@ -78,6 +78,11 @@ public class EditActivity extends ListActivity implements AdapterView.OnItemClic
selector.show(getFragmentManager(), "behaviour_selector");
return true;
}
else if (id == R.id.action_clear) {
executor.getBehaviourList().clear();
adapter.notifyDataSetChanged();
return true;
}
return super.onOptionsItemSelected(item);
}

View file

@ -5,5 +5,8 @@
<item android:id="@+id/action_add"
android:title="@string/action_add"
android:showAsAction="withText|ifRoom" />
<item android:id="@+id/action_clear"
android:title="@string/action_clear"
android:showAsAction="withText|ifRoom" />
</menu>

View file

@ -35,5 +35,6 @@
<string name="action_select">Select</string>
<string name="pref_throughput_type">Throughput Type</string>
<string name="pref_throughput_type_summ">The type of throughput that should be displayed and logged</string>
<string name="action_clear">Clear</string>
</resources>