Android-progressBar wird nicht angezeigt

Habe ich eine progressbar soll laufen in einem AsyncTask , aber es ist nicht angezeigt, obwohl der task ausgeführt wird

XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:background="@drawable/splashportrait">
<ProgressBar android:layout_alignParentBottom="true" android:indeterminate="true"
    android:layout_centerHorizontal="true" android:paddingBottom="450dip"
    android:layout_width="200dip" android:layout_height="200dip"
    android:id="@+id/progressBar1"></ProgressBar>
</RelativeLayout>

CODE:

ProgressBar diagProgress;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splashscreen);

    diagProgress = (ProgressBar)findViewById(R.id.progressBar1);
    DiagnosticsTask diag = new DiagnosticsTask();
    diag.execute();

  /**rest of class ommitted here**/
}

private class DiagnosticsTask extends AsyncTask<String, String, Boolean> {

    //Show spinner
    protected void onPreExecute() {
        //dialog.setMessage("Loading corresponding destinations...");
        //dialog.show();
        diagProgress.setVisibility(View.VISIBLE);
        diagProgress.showContextMenu();
        Log.e("AsyncStatus", "spinner shown");
    }
 /*other parts of the thread ommitted here*/

}
  • hey ur-problem gelöst?
InformationsquelleAutor CQM | 2011-09-16
Schreibe einen Kommentar