Extend the progress dialog class where you do customisation
public class CustomProgressDialogClass extends ProgressDialog{
public CustomProgressDialogClass(Context context) {
super(context, R.style.CustomDialogThemeForPorgressbar);
// TODO Auto-generated constructor stub
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.progress_layout);
}
}
In layout progress_layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/progressbar_layout">
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:background="@drawable/loader_bg" >
<ProgressBar
android:id="@+id/progressbarlayout_progressbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
In values folder create styles folder and paste this
<style name="CustomDialogThemeForPorgressbar" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowIsFloating">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:gravity">center</item>
</style>
Do the changes to windowIsFloating,gravity and windowNoTitle to show in tab host