I am developing an application where in I have share and Rate options. When I click on these options I trigger an Intent which handles further proceedings. What I want is the dialog box these Intents open have some device default theme. So that different devices' dialog boxes will appear different. Also I have one dialog box for settings. How can I set the device default theme to this custom dialog that I have programatically? Thanks.
Craete a theme in style.xml and then you can pass the theme to dialog's constructor as:
Dialog d = new Dialog(getApplicationContext(), R.style.TransparentTheme);
here TransparentTheme is the name of theme I've defined in style.xml
Define this theme in style.xml and set it programmatically
<style name="DialogTheme" parent="android:Theme.Dialog">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
<!-- No backgrounds, titles or window float -->
<item name="android:windowNoTitle">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowIsFloating">false</item>
</style>
I hope this will help.Thanks!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With