How to open a Dialog without darkening the Android background screen

Asked

Viewed 203 times

1

I have an Activity, and in this one I call a Dialog, but when I open this 'popup' the background Activity screen that called it darkens, but I wish that didn’t happen. You can do it?

  • Have you tried a custom dialog? http://www.mkyong.com/android/android-custom-dialog-example/

1 answer

1

You can set a specific theme for Activity, so it will not darken when opening any Dialog:

<resources>
  <style name="Dialog" parent="AppTheme">
    <item name="android:backgroundDimEnabled">false</item>
  </style>
</resources>

And in your manifest, you arrow this theme to the Activity that does not want to darken when opening the dialog:

<activity android:name=".MinhaActivity" android:theme="@style/Dialog">

Browser other questions tagged

You are not signed in. Login or sign up in order to post.