User7723337
User7723337

Reputation: 12018

How to hide blank/black activity window behind the Dialog

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 are just displaying Dialog.

Thank, PP.

Upvotes: 2

Views: 3672

Answers (3)

Junaid
Junaid

Reputation: 3945

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

Upvotes: 0

om252345
om252345

Reputation: 2415

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...

Upvotes: 3

maid450
maid450

Reputation: 7486

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"

Upvotes: 0

Related Questions