Android: Create full screen dialog

Reference: http://stackoverflow.com/questions/2773502/android-custom-popupwindow-dialog

Extends from a new dialog from Dialog:

Dialog dialog = new Dialog(this, R.style.full_screen_dialog) {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.choose_device_name_dialog);
            getWindow().setLayout(LayoutParams.FILL_PARENT,
                     LayoutParams.FILL_PARENT);
      }
};

Create a full screen dialog style in styles.xml
      <style name=”full_screen_dialog”>
          <item name=”android:windowFrame”>@null</item>
          <item name=”android:windowIsFloating”>true</item>
          <item name=”android:windowContentOverlay”>@null</item>
          <item name=”android:windowAnimationStyle”>@android:style/Animation.Dialog</item>
          <item name=”android:windowSoftInputMode”>stateUnspecified|adjustPan</item>
      </style>

This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.