void showDialogOfMsg()
{
Dialog dialog = new Dialog(getActivity());
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.dialog_of_msg_list);
int width = getActivity().getWindowManager().getDefaultDisplay().getWidth();
LinearLayout lay = (LinearLayout)dialog.findViewById(R.id.lay);
ViewGroup.LayoutParams params = lay.getLayoutParams();
params.width = width;
lay.setLayoutParams(params);
dialog.show();
}
other way
Window window = introDialog.getWindow();
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int widthContentView = displaymetrics.widthPixels - 5;
int heightContentView = displaymetrics.heightPixels - 10;
window.setLayout(widthContentView , heightContentView);
Comments
Post a Comment