---
title: "Dialog activity matching parent's width"
date: 2018-09-22T19:17:41.000Z
author: Z.SHINCHVEN
tags: [Android]
canonical: https://atlassc.net/2018/09/23/dialog-activity-matching-parent-width
---
## Extend your theme from .Dialog.Alert

```xml
<style name="YOUR_THEME_NAME" parent="@style/Theme.AppCompat.Light.Dialog.Alert">
    <!--your theme here-->
</style>
```

**Do not extend your theme from .Dialog, if you want your dialog to match parent/window's width.**

```xml
<style name="YOUR_THEME_NAME" parent="@style/Theme.AppCompat.Light.Dialog.Alert">
    <!--your theme here-->
</style>
```
