diff options
Diffstat (limited to 'vdrmanager/src')
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrListActivity.java | 22 |
1 files changed, 11 insertions, 11 deletions
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<Vdr>(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); } |