Bug in lib support V7 with startSupportActionMode

2019-08-31 05:34发布

问题:

In a ActionBarActivity (lib support V7), when i call startSupportActionMode() from my nexus 4 (4.3), in callback, i have a double call to onPrepareActionMode() because the onDestroyActionMode is also called.

In other terms, the bug is:

1 > startSupportActionMode(callback); 2 > callback.onPrepareActionMode() is triggered 3 > callback.onDestroyActionMode() is triggered (not by me, not normal) 4 > callback.onPrepareActionMode() is triggered

The good result must be: 1 > startSupportActionMode(callback); 2 > callback.onPrepareActionMode() is triggered and only if i call actionmode.finish(), callback.onDestroyActionMode() is triggered

if I use startActionMode() (native api version), no problem...

i've create an issue on b.android.com and there is an exemple project. https://code.google.com/p/android/issues/detail?id=59714

回答1:

this is a known issue and will be fixed in the next release of AppCompat

https://code.google.com/p/android/issues/detail?id=58321