I am trying to make the background from my dialog transparent. I want the progress bar to be shown in front of my activity. Unfortunately, the background stays always white.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/loading_cont"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:backgroundTint="#00000000"
android:background="@android:color/transparent"
>
<RelativeLayout
android:id="@+id/loading_dialog_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="#00000000"
android:background="@android:color/transparent"
>
<ProgressBar
android:id="@+id/login_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerInParent="true" >
</ProgressBar>
</RelativeLayout>
2
Answers
Make a new
Drawable Resource file
namedtransparent.xml
.transparent.xml
Now set
android:background="@drawable/transparent"
Add this code where you are initializing your dialog
or you can also add this code instead