コード例 #1
0
  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));
    }
  }
コード例 #2
0
 @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();
 }