I have one Activity which displayed some Dialog boxes and Progress bars.
This activity does not have call to setContentView as this Activity does not have Screen Layout. It has been just used for displaying Dialogs and progress bar dialogs.Now what happens is that Activity Displays Dialog box along with the Blank Activity Window on back of the Dialog, So i want to hide make it transparent so it will look like we 开发者_JS百科are just displaying Dialog.
Thank, PP.
Use this attribute for your activity
<activity android:theme="@android:style/Theme.Translucent">
This will make activity background transparent.
In your activity tag(in manifest) which is displaying progressbar or dialog
put this above attribute android:theme="@android:style/Theme.Translucent
This will work...
Try applying the dialog theme to this activity:
In your manifest file add to the activity
element this attribute: android:theme="@android:style/Theme.Dialog"
Copied from background - Android: make everything around dialog darker
All you need to do is play around with the dimAmount field in the
WindowManager.LayoutParams: WindowManager.LayoutParams lp = myDialog.getWindow().getAttributes(); lp.dimAmount = 0.7f
精彩评论