0

I want to open Activity as a Dialog. I tried the codes below :

Added this style in style.xml

<style name="NoTitleDialog" parent="Theme.AppCompat.Dialog.Alert">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
</style>

And In Manifest :

<activity
    android:name=".ui.AddVideoView"
    android:windowSoftInputMode="stateHidden|adjustResize"
    android:theme="@style/NoTitleDialog"/>

XML

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="@dimen/_140sdp"
    android:layout_gravity="center_vertical"
    >

        <VideoView
            android:id="@+id/videoView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            />

</LinearLayout>

The Dialog showed perfectly but it's blurry. So how do I show the dialog perfectly without the overlay?

See below image for better understanding :

enter image description here

Thanks in advance :)

Joker
  • 796
  • 1
  • 8
  • 24

1 Answers1

1

try adding this line to your code:

dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);

or you can preventing from dim effect like this:

dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
kAvEh
  • 534
  • 4
  • 15