Added workaround for ActionMode bug

https://code.google.com/p/android/issues/detail?id=58321
This commit is contained in:
daniel oeh 2013-09-04 20:11:56 +02:00
parent 196f5407ce
commit 88cfe71f75
1 changed files with 12 additions and 6 deletions

View File

@ -1,7 +1,5 @@
package de.danoeh.antennapod.fragment;
import java.util.List;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.DialogInterface;
@ -14,7 +12,6 @@ import android.support.v7.view.ActionMode;
import android.util.Log;
import android.view.*;
import android.widget.*;
import de.danoeh.antennapod.AppConfig;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.FeedItemlistActivity;
@ -29,6 +26,8 @@ import de.danoeh.antennapod.storage.DownloadRequestException;
import de.danoeh.antennapod.storage.FeedItemStatistics;
import de.danoeh.antennapod.util.menuhandler.FeedMenuHandler;
import java.util.List;
public class FeedlistFragment extends Fragment implements
ActionMode.Callback, AdapterView.OnItemClickListener,
AdapterView.OnItemLongClickListener {
@ -244,11 +243,18 @@ public class FeedlistFragment extends Fragment implements
return true;
}
private boolean actionModeDestroyWorkaround = false; // TODO remove this workaround
@Override
public void onDestroyActionMode(ActionMode mode) {
mActionMode = null;
selectedFeed = null;
fla.setSelectedItemIndex(FeedlistAdapter.SELECTION_NONE);
if (actionModeDestroyWorkaround) {
mActionMode = null;
selectedFeed = null;
fla.setSelectedItemIndex(FeedlistAdapter.SELECTION_NONE);
actionModeDestroyWorkaround = false;
} else {
actionModeDestroyWorkaround = true;
}
}
@Override