Inside activity where we r calling the Fragment there we have to write following code before calling the fragment:-
mFrameLayout is the FrameLayout which we keep inside activity layout.
mFrameLayout.setVisibility(View.VISIBLE); mFrameLayout.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true;// return true } });