下面列出了android.view.ActionMode#TYPE_PRIMARY 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
public ActionMode onWindowStartingActionMode(ActionMode.Callback callback) {
if (mActionBar != null && mActionModeTypeStarting == ActionMode.TYPE_PRIMARY) {
return mActionBar.startActionMode(callback);
}
return null;
}
@Override
public ActionMode onWindowStartingActionMode(ActionMode.Callback callback, int type) {
try {
mActionModeTypeStarting = type;
return onWindowStartingActionMode(callback);
} finally {
mActionModeTypeStarting = ActionMode.TYPE_PRIMARY;
}
}
@Override
public ActionMode startActionModeForChild(
View child, ActionMode.Callback callback, int type) {
// Disable Primary Action Modes in the SearchBar, as they overlap.
if (type != ActionMode.TYPE_PRIMARY) {
return super.startActionModeForChild(child, callback, type);
}
return null;
}