I am using Alert Dialog having RecyclerView with custom adapter.
Issue is : on opening dialog : keyboard comes under the dialog.
I tried to implement :
AlertDialog alert = dialog.create();
                alert.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
              //  alert.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
                alert.show();
and showed keyboard in adapter class with this :
 inputHoursEt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
                @Override
                public void onFocusChange(View v, boolean hasFocus) {
                    if (hasFocus) {
                        InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
                        imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
                    }
                }
            });
also tried in manifest file this for main activity:
android:windowSoftInputMode="adjustResize"
EDIT:
Complete code for dialog:
 private void openEnterResourceHoursDialog(int i, String selectedActivityId, String selectedActivityName) {
        loader.dismiss();
            Log.i(Constants.APP_NAME, "total resources : "+resourceListItems.size());
            if (resourceListItems.size()>0){
                final AlertDialog.Builder dialog = new AlertDialog.Builder(getActivity());
                LayoutInflater factory = LayoutInflater.from(getActivity());
                final View content = factory.inflate(R.layout.resource_dialog, null);
                RecyclerView detailsRecyclerView = (RecyclerView) content.findViewById(R.id.resourceListRv);
                LinearLayoutManager llm = new LinearLayoutManager(getActivity());
                detailsRecyclerView.setLayoutManager(llm);
                llm.setOrientation(LinearLayoutManager.VERTICAL);
                Button detailSubmitButton = (Button) content.findViewById(R.id.enterBtn);
                Button detailsCloseButton = (Button) content.findViewById(R.id.cancelBtn);
                TextView activityNameTv = (TextView) content.findViewById(R.id.activityNameTv);
                activityNameTv.setText(selectedActivityName);
                ResourceListAdapter detailsAdapter = new ResourceListAdapter(getActivity(), resourceListItems);
                detailsRecyclerView.setAdapter(detailsAdapter);
                dialog.setView(content);
                dialog.setCancelable(false);
                final AlertDialog alert = dialog.create();
                alert.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE  );
              //  alert.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
                alert.show();
                detailsCloseButton.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        alert.dismiss();
                        InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
                        imm.toggleSoftInput(InputMethodManager.RESULT_HIDDEN,0);
                    }
                });
                detailSubmitButton.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        alert.dismiss();
                        InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
                        imm.toggleSoftInput(InputMethodManager.RESULT_HIDDEN,0);
                    }
                });
            }else{
                utils.showShortToast(getActivity(),"There is no resource");
            }
        }
