setProgressBarIndeterminateVisibility(true)不起作用

时间:2015-08-04 11:42:14

标签: android android-asynctask progress-bar

我希望在asynctask工作时使用进度条,但是没有显示,我已经得到以下代码:

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);
}

而且,在我的asyncTask的postExecute中我得到了这个:

protected void onPostExecute(HighScoreList highScoreList) {
        scoreActivity.this.setProgressBarIndeterminate(false);
        scoreActivity.this.setProgressBarIndeterminateVisibility(false);
}

它没有显示任何进度指示器,我无法找到错误。谢谢。

0 个答案:

没有答案