2

I want to use contextual action bar in my app. When I start action mode, There are padding between default actionbar and contextual actionbar as shown in image 2. How can I avoid this padding ? enter image description here

for start action mode

startSupportActionMode(modeCallBack);

callback method :

private ActionMode.Callback modeCallBack = new ActionMode.Callback() {
        @Override
        public boolean onCreateActionMode(ActionMode mode, Menu menu) {
            MenuInflater inflater = mode.getMenuInflater();
            inflater.inflate(R.menu.driver_main_menu, menu);
            return true;
        }

        @Override
        public boolean onPrepareActionMode(ActionMode mode, Menu menu) {

            return false;
        }

        @Override
        public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
            switch (item.getItemId()) {
                case R.id.action_send:
                    Toast.makeText(getApplicationContext(), "Send!", Toast.LENGTH_SHORT).show();

                    mode.finish();
                    return true;
                default:
                    return false;
            }
        }

        @Override
        public void onDestroyActionMode(ActionMode mode) {

        }
    };
yusufonderd
  • 3,237
  • 4
  • 21
  • 34

0 Answers0