I wish to use a progressbar while an asynctask is working but just doesn't appear, I've got the following code:
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_score);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actualizartablaF();
}
private void actualizarTablaF(){
setProgressBarIndeterminate(true);
setProgressBarIndeterminateVisibility(true);
SharedPreferences sp = getSharedPreferences("Preferences", Activity.MODE_PRIVATE);
String param = "?name="+sp.getString("Name","Josema");
new ScoresAsyncTask().execute(param);
}
And, in the postExecute of my asyncTask I've got this:
protected void onPostExecute(HighScoreList highScoreList) {
scoreActivity.this.setProgressBarIndeterminate(false);
scoreActivity.this.setProgressBarIndeterminateVisibility(false);
}
It just doesn't show any progress indicator and I can't find the mistake. Thank you.
Aucun commentaire:
Enregistrer un commentaire