3

Possible Duplicate:
Calling android dialog without it fading the backgorund

Is there any way to show a dialog (basically, new Dialog(this).show() ) that does not "fade" the background activity?

I don't want the activity behind to have focus but I want it to be clearly visible and not fade away.

Thanks

Community
  • 1
  • 1
Raz
  • 458
  • 4
  • 11
  • 1
    See this link: http://stackoverflow.com/questions/3113812/calling-android-dialog-without-it-fading-the-backgorund – Thommy Nov 23 '11 at 08:46

2 Answers2

2

This question already answered here Calling android dialog without fading the background

Basically you could make a style resource in res/values/styles.xml like this:

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="myBackgroundStyle" parent="android:Theme">
    <item name="android:backgroundDimEnabled">false</item>
  </style>
</resources>

then use it when you construct new dialog:

Dialog dialog = new Dialog(this, R.styles.myBackgroundStyle);
Community
  • 1
  • 1
kyuuCR
  • 51
  • 4
  • You should flag the question as a duplicate in situations like this instead of posting a duplicate answer. – Adam Lear Nov 24 '11 at 14:07
0

Try to use Dialog (Context context, int theme) constructor. As theme parameter use Your own theme (similar to com.android.internal.R.style.Theme_Dialog used in dialog by default). For more details on theme, please check out data/res/themes.xml (Theme.Dialog) in You android platform directory. Basically You could just change dialog window background to transparent one.

sandrstar
  • 12,503
  • 8
  • 58
  • 65