Question

I have an activity with the dialog theme applied as below

<activity
            android:name="com.denso.phone3.IncomingCallActivity"
            android:label="@string/app_name"
            android:launchMode="singleInstance"
            android:theme="@style/Theme.Transparent" >
</activity>

the theme is as below

<style name="Theme.Transparent" parent="Theme.NoTitle">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:backgroundDimEnabled">true</item>
        <item name="android:backgroundDimAmount">0.5</item>
        <item name="android:windowFullscreen">true</item>
</style>

In spite of all this my dialog looks like thisflaw. As you can see there is some space left on the right and bottom.FYI, This is the behaviour of all the dialogs on my machine.

Some one on SO suggested this as fix , which didn't work.

setContentView(R.layout.activity_incoming_call);
getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
Was it helpful?

Solution

Using android Theme fixed the issue

<activity
            android:name="com.denso.phone3.IncomingCallActivity"
            android:label="@string/app_name"
            android:launchMode="singleInstance"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" >
</activity>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top