Try like below:
LayoutInflater factory = LayoutInflater.from(Splash.this);
View DialogView = factory.inflate(
R.layout.custom_progress_layout, null);
Dialog main_dialog = new Dialog(Splash.this,R.style.Theme_Dialog);
main_dialog.setContentView(DialogView);
main_dialog.show();
And create Theme_Dialog
into values\styles.xml
<style name="Theme_Dialog" parent="android:Theme.Holo.Dialog">
<item name="android:backgroundDimEnabled">false</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
This is perfect working in my case.
Update: you just need to change both your RelativeLayout
attribute width with android:layout_width="wrap_content"
into your layout.xml
.