Reputation: 4807
I have created custom dialog that located in values/styles:
<style name="AppTheme" parent="android:Theme.Light" />
<style name="MyDialogTheme" parent="android:Theme.Dialog">
<item name="android:windowBackground">@null</item>
<item name="android:windowNoTitle">true</item>
</style>
And then I wish to use it:
final Dialog dialogC = new Dialog(context,R.style.MyDialogTheme);
dialogC.setContentView(R.layout.confirm);
I get no errors, but it still uses the default theme. This theme worked perfectly when I used it for an activity that I wished to appear as dialog.
Upvotes: 0
Views: 65
Reputation: 612
use this one, it's work for me
dialog3=new Dialog(MainActivity.this);
dialog3.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog3.setContentView(R.layout.one_button_dialog4);
Upvotes: 1