From c4ba2bc1e9e9e074d741915018eb8dac06d92822 Mon Sep 17 00:00:00 2001 From: lado Date: Wed, 24 Jul 2013 11:47:02 +0200 Subject: add over menu --- .../bjusystems/vdrmanager/gui/VdrListActivity.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'vdrmanager/src/de/bjusystems') diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrListActivity.java index 85dbe8f..a499d00 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrListActivity.java @@ -29,8 +29,8 @@ import de.bjusystems.vdrmanager.data.Preferences; import de.bjusystems.vdrmanager.data.Vdr; import de.bjusystems.vdrmanager.data.db.DBAccess; -public class VdrListActivity extends ListActivity - implements OnItemClickListener, OnItemLongClickListener { +public class VdrListActivity extends ListActivity implements + OnItemClickListener, OnItemLongClickListener { private static final String TAG = VdrListActivity.class.getName(); @@ -78,13 +78,6 @@ public class VdrListActivity extends ListActivity setContentView(R.layout.vdr_list_add_delete); - findViewById(R.id.add_item).setOnClickListener( - new View.OnClickListener() { - public void onClick(View v) { - editVdr(null); - } - }); - // initCursor(); final Vdr cur = Preferences.get().getCurrentVdr(); adapter = new ArrayAdapter(this, @@ -245,8 +238,12 @@ public class VdrListActivity extends ListActivity new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { - if (DBAccess.get(VdrListActivity.this).getVdrDAO().deleteById( - adapter.getItem(position).getId()) > 0) { + if (DBAccess + .get(VdrListActivity.this) + .getVdrDAO() + .deleteById( + adapter.getItem(position) + .getId()) > 0) { if (Preferences.get().getCurrentVdrContext( VdrListActivity.this) == id) { Preferences.setCurrentVdr( @@ -281,6 +278,9 @@ public class VdrListActivity extends ListActivity BackupSettingsActivity.class); startActivity(intent); return true; + } else if (item.getItemId() == R.id.main_menu_vdrlist_add) { + editVdr(null); + return true; } return super.onOptionsItemSelected(item); } -- cgit v1.2.3