Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- android:theme="@android:style/Theme.Dialog"
- @Override
- protected void onCreate(Bundle arg0) {
- super.onCreate(arg0);
- setContentView(R.layout.myxml);
- LayoutParams params = getWindow().getAttributes();
- params.height = LayoutParams.FILL_PARENT;
- params.width = LayoutParams.FILL_PARENT;
- getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
- }
- getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
- @Override
- protected void onStart() {
- super.onStart();
- // In order to not be too narrow, set the window size based on the screen resolution:
- final int screen_width = getResources().getDisplayMetrics().widthPixels;
- final int new_window_width = screen_width * 90 / 100;
- LayoutParams layout = getWindow().getAttributes();
- layout.width = Math.max(layout.width, new_window_width);
- getWindow().setAttributes(layout);
- }
Add Comment
Please, Sign In to add comment