Add edit button to menu and handle item single click events only if

contextual action bar is disabled
This commit is contained in:
Ricardo Carrillo Cruz
2013-04-20 11:48:33 +02:00
parent dff1d9811f
commit c6f1d7267c

View File

@@ -80,6 +80,9 @@ public class LoginActivity extends ListActivity implements Receiver {
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
switch (item.getItemId()) {
case R.id.edit:
mode.finish();
return true;
case R.id.clone:
mode.finish();
return true;
@@ -104,6 +107,7 @@ public class LoginActivity extends ListActivity implements Receiver {
}
protected void onListItemClick(ListView l, View v, int position, long id) {
if(mActionMode == null) {
ConnectionProfile profileClicked = (ConnectionProfile) getListAdapter().getItem(position);
Intent intent = new Intent(this, CloudControllerService.class);
@@ -120,6 +124,7 @@ public class LoginActivity extends ListActivity implements Receiver {
startService(intent);
}
}