tengo la barra de progreso que se supone para funcionar en un AsyncTask, pero no aparece, aunque la tarea se ejecutaAndroid progressBar no mostrar
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>
CÓDIGO:
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 problema resuelto? – shyam