android - how to set cancellable false to an activity when it is opened as a Dialog? -


hi have made n activity in open activity dialog popup on activity ,so g.ot problem of theme,

 <item `name="android:windowcloseontouchoutside">@bool/config_closedialogwhentouchoutside</item>` 

but dont know value should change inside "windowcloseontouchoutside" can activity dialog set cancellable false..? code in theme below:

 <style name="theme.dialog">         <item name="android:windowframe">@null</item>         <item name="android:windowtitlestyle">@android:style/dialogwindowtitle</item>         <item name="android:windowbackground">@android:drawable/panel_background</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>         <item name="android:windowcloseontouchoutside">@bool/config_closedialogwhentouchoutside</item>         <item name="android:windowactionmodeoverlay">true</item>          <item name="android:colorbackgroundcachehint">@null</item>          <item name="textappearance">@android:style/textappearance</item>         <item name="textappearanceinverse">@android:style/textappearance.inverse</item>          <item name="textcolorprimary">@android:color/primary_text_dark</item>         <item name="textcolorsecondary">@android:color/secondary_text_dark</item>         <item name="textcolortertiary">@android:color/tertiary_text_dark</item>         <item name="textcolorprimaryinverse">@android:color/primary_text_light</item>         <item name="textcolorsecondaryinverse">@android:color/secondary_text_light</item>         <item name="textcolortertiaryinverse">@android:color/tertiary_text_light</item>         <item name="textcolorprimarydisableonly">@android:color/primary_text_dark_disable_only</item>         <item name="textcolorprimaryinversedisableonly">@android:color/primary_text_light_disable_only</item>         <item name="textcolorprimarynodisable">@android:color/primary_text_dark_nodisable</item>         <item name="textcolorsecondarynodisable">@android:color/secondary_text_dark_nodisable</item>         <item name="textcolorprimaryinversenodisable">@android:color/primary_text_light_nodisable</item>         <item name="textcolorsecondaryinversenodisable">@android:color/secondary_text_light_nodisable</item>         <item name="textcolorhint">@android:color/hint_foreground_dark</item>         <item name="textcolorhintinverse">@android:color/hint_foreground_light</item>         <item name="textcolorsearchurl">@android:color/search_url_text</item>          <item name="textappearancelarge">@android:style/textappearance.large</item>         <item name="textappearancemedium">@android:style/textappearance.medium</item>         <item name="textappearancesmall">@android:style/textappearance.small</item>         <item name="textappearancelargeinverse">@android:style/textappearance.large.inverse</item>         <item name="textappearancemediuminverse">@android:style/textappearance.medium.inverse</item>         <item name="textappearancesmallinverse">@android:style/textappearance.small.inverse</item>          <item name="listpreferreditempaddingleft">10dip</item>         <item name="listpreferreditempaddingright">10dip</item>         <item name="listpreferreditempaddingstart">10dip</item>         <item name="listpreferreditempaddingend">10dip</item>          <item name="preferencepanelstyle">@style/preferencepanel.dialog</item>     </style> 

you can in java coding easily. if have activity (even if looks dialog), should do

this.setfinishontouchoutside(false); 

if have used dialog class, should call

dialog.setfinishontouchoutside(false)  

if want prevent closing open when background activity clicked.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -