-1

progress dialog box

I have researched a lot about it but could not find anything should i use Async task for my progress dialog or is is possible that that the duplicate dialog box is showing due to super.show();.Please refer the image above

Below is my code:

private ProgressDialog m_dialog = null;

if (m_dialog == null){
    m_dialog = new Dialog(...); // initiate it the way you need
    m_dialog.show();
} 
else if (!m_dialog.isShowing()){
    m_dialog.show();
}
Isha
  • 11
  • 6

1 Answers1

0

use follow link Remove progress bar background in android progress bar if it is not use full plese Make the custom Progressbar as following make the custom AlertDialog

public static AlertDialog getAlertProgress(Activity mActivity)
{

    final AlertDialog alertDialog;
    final AlertDialog.Builder builder;

    LayoutInflater inflater = (LayoutInflater)mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    View layout = inflater.inflate(R.layout.process_layout,null,false);

    AVLoadingIndicatorView avLoadingIndicatorView = (AVLoadingIndicatorView)layout.findViewById(R.id.progress_avi);

    avLoadingIndicatorView.show();
    builder = new AlertDialog.Builder(mActivity);

    builder.setView(layout);
    alertDialog = builder.create();
    alertDialog.setCancelable(false);
    alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
return alertDialog;

}

or xml file is

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:background="@android:color/transparent"
    >
//here i use the libery progress accordint to my project you can use progress bar here
    <com.wang.avi.AVLoadingIndicatorView
    android:background="@android:color/transparent"
    android:layout_centerInParent="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/progress_avi"
    android:visibility="visible"
    app:indicatorName="LineScaleIndicator"
    app:indicatorColor="@color/bagintero2"/>

</LinearLayout>

</RelativeLayout>

or you can use it where you want or when you want .. for using if do

    Alertdialog alertdialog = Clasneme.getAlertprogress(activityName.this);
    alertdialog.show;

or when you want to dismiss

       alertdialog.dismiss;
Community
  • 1
  • 1
laxmikant
  • 71
  • 9
  • you can use a progressBar with a text to the right that should be better than trying to remove a background behind a ProgressDialog – Anirudh Goud Nov 12 '16 at 14:43