1

In Java file:

Dialog dialog = new Dialog(Dashboard.this, R.style.FullHeightDialog);
dialog.setContentView(R.layout.progress_dialog);
dialog.show();

progress_dialog.xml

<?xml version="1.0" encoding="utf-8"?>
<com.xorin.ress.gprogressbar.SmoothProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/pbar"
    style="@style/GNowProgressBar"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center"
    android:indeterminate="true" />

output comes like:

enter image description here

I want to display center progress bar with full width which is currently not displaying..

Sagar Maiyad
  • 12,655
  • 9
  • 63
  • 99

1 Answers1

0

use ProgressDialog like

Object localObject = new ProgressDialog(getParent());
    ((ProgressDialog) localObject).setTitle("");
    ((ProgressDialog) localObject).setMessage("Please wait...");
    ((ProgressDialog) localObject).setCancelable(true);
    ((ProgressDialog) localObject)
            .setOnCancelListener(new DialogInterface.OnCancelListener()      {
                public void onCancel(
                        DialogInterface paramAnonymousDialogInterface) { }