I want to change the background color of ActionMode. I am using AppCompactActivity and so using v4 Fragment.
I tried to change the background color of action mode using below code:
int amId = getResources().getIdentifier("action_context_bar", "id", "android");
View view = findViewById(id);
view.setBackground(actionModeBackground);
Above code is working fine in case of activity, but in case of fragments, how to get the action bar context view by calling findViewById as in fragments we need parent view to get the child views.
Please suggest me approach to get action bar view in fragments.
Thanks.
I found the solution by using getActivity() function for AppCompactActivity.