Question:
How to call something dialog without ActionBar
so that only the layout
file is highlighted. The options with hiding / killing the ActionBar
\ changing the theme of the Activity
“ DialogFragment '' (if possible) will also work.
The attempts I've tried but nothing came out:
- Make an
Activity
with themes@android:style/Theme.Dialog.NoTitleBar
and@android:style/Theme.NoTitleBar.Dialog
. - Make an
Activity
with themes@android:style/Theme.Dialog.NoTitleBar
and@android:style/Theme.NoTitleBar.Dialog
. Make aDialogFragment
, and then remove, hide theActionBar
– it turns out that theDialogFragment
does not have anActionBar
(at leastgetActionBar
does not work). - Make your
style
withDialog
andNoTitleBar
. It didn't work out at all.
Help me please!
Answer:
Here is one of the options for solving your problem:
-
If using
Dialog
:Dialog dialog = new Dialog(context); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.my_dialog_la); dialog.show();
-
If you extend
DialogFragment
, then add the following line toonCreate
:setStyle(STYLE_NO_TITLE, 0);