2016-11-12 2 views
-1

progress dialog boxWie soll ich den leeren Dialog hinter meinem Fortschrittsdialog entfernen?

Ich habe viel darüber recherchiert, aber nichts sollte für meinen Fortschritt Dialog i verwenden Async Aufgabe oder ist möglich finden konnte, dass das Duplikat Dialogfeld aufgrund zeigt auf super.show() ;. Bitte siehe das Bild oben

Unten ist mein 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(); 
} 

Antwort

0

Verwendung folgendem Link Remove progress bar background in android progress bar wenn es voll plese nicht Progressbar machen sie die benutzerdefinierte verwenden, wie die benutzerdefinierte folgenden machen 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; 

} 

oder XML-Datei ist

<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> 

oder Sie können es verwenden, wo Sie oder wollen, wenn Sie .. wollen für die Verwendung, wenn tun

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

oder wenn Sie wollen entlassen

 alertdialog.dismiss; 
+0

wenn dies für Sie funktioniert ase up Abstimmung zu meinem answare .. – laxmikant

+0

Sie können eine progressBar mit einem Text auf der rechten Seite verwenden, die besser sein sollte, als zu versuchen, einen Hintergrund hinter einem ProgressDialog zu entfernen –

Verwandte Themen