I have a grid of 9 surfaceViews in a layout. The user can click on any surfaceView to load a camera. During the loading process I need to show a ProgressDialog over that surface view. Currently I am doing it this way.
pd = new ProgressDialog(getActivity(), R.style.MyTheme);
pd.getWindow().setGravity(Gravity.CENTER_VERTICAL);
pd.setCancelable(false);
pd.setProgressStyle(android.R.style.Widget_Holo_ProgressBar_Large);
pd.show();
This is obviously showing a progress dialog but it will be in the center of the screen.
How can I make it center over the surfaceView?