private void openActionMode(int position) { mActionMode = startSupportActionMode(callback); mAdapter.setItemChecked(position); updateTitleBar(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.secondaryText)); } }
@Override public void OnItemClick(View v, int position) { if (mActionMode != null) { mAdapter.setItemChecked(position); updateTitleBar(); } else Toast.makeText( MainActivity.this, mPersons.get(position).getName() + " Click", Toast.LENGTH_LONG) .show(); }