Code to Display Dialog With no Title bar and Display it on Centre of Screen,Android

In Manifest file use this theme for your Activity:
  <activity
            android:name=".PL.PLAddNewTicketScreen"
            android:configChanges="orientation|keyboardHidden"
            android:screenOrientation="portrait"
            android:theme="@style/CustomDialogTheme"
            android:windowSoftInputMode="stateHidden" >
        </activity>
-------------------------------------------------------
and style.xml file will look like this:
 <style name="CustomDialogTheme" parent="@android:style/Theme.Dialog">
    <item name="android:windowBackground">@color/transprent</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:windowNoTitle">true</item>
   </style>
And no need to do any changes on ur Activity(like adding activity layout to dialog.)
   then u will get the output like this :


 

Comments

Popular posts from this blog

Custom Dialog with no title and full screen in Android

Best working code to set Date limits on Date Picker Dialog,in Android

code to display .pdf,.text,.DOC,.DOCX,.doc extension files exists in SDCard