android - Using AppCompatDialog Removes titles from the Dialog -


once switched actionbaractivity appcompatactivity 1 of changes did add line:

 <item name="windownotitle">true</item> 

here entire styles.xml file:

<style name="gptheme" parent="theme.appcompat.light.darkactionbar">     <item name="colorprimary">@color/primary</item>     <item name="colorprimarydark">@color/primarydark</item>     <item name="coloraccent">@color/accent</item>     <item name="android:windowcontentoverlay">@null</item> </style>  <style name="themenoactionbar" parent="gptheme">     <item name="windowactionbar">false</item>     <item name="windownotitle">true</item> </style> 

now, new appcompatdialogs in code, (which formerly dialog d = new dialog(mcontext), have no titles though use settitle().

obviously change made titles specified windownotitle should affect parent activity. think, anyway.

how new feature work?

// style.xml

<style name="dialogactivity" parent="theme.appcompat.dialog">     <item name="android:windownotitle">true</item>     <item name="coloraccent">#fff</item> </style> 

// manifest.xml

<activity   android:name=".mypopupactivity"   android:theme="@style/dialogactivity"/> 

// activity

import android.app.activity; public class mypopupactivity extends activity {   @override   protected void oncreate(bundle savedinstancestate)   {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_my_popup);   } } 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -