Applied Action Mode workaround to DownloadActivity
This commit is contained in:
parent
15446f1847
commit
abb3aaf5d9
|
@ -9,6 +9,7 @@ import android.content.IntentFilter;
|
||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.support.v4.app.NavUtils;
|
import android.support.v4.app.NavUtils;
|
||||||
|
@ -239,11 +240,19 @@ public class DownloadActivity extends ActionBarActivity implements
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean actionModeDestroyWorkaround = false; // TODO remove this workaround
|
||||||
|
private boolean skipWorkAround = Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyActionMode(ActionMode mode) {
|
public void onDestroyActionMode(ActionMode mode) {
|
||||||
mActionMode = null;
|
if (skipWorkAround || actionModeDestroyWorkaround) {
|
||||||
selectedDownload = null;
|
mActionMode = null;
|
||||||
dla.setSelectedItemIndex(DownloadlistAdapter.SELECTION_NONE);
|
selectedDownload = null;
|
||||||
|
dla.setSelectedItemIndex(DownloadlistAdapter.SELECTION_NONE);
|
||||||
|
actionModeDestroyWorkaround = false;
|
||||||
|
} else {
|
||||||
|
actionModeDestroyWorkaround = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private BroadcastReceiver contentChanged = new BroadcastReceiver() {
|
private BroadcastReceiver contentChanged = new BroadcastReceiver() {
|
||||||
|
|
Loading…
Reference in New Issue