gpt4 book ai didi

安卓进度条不显示

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:16:01 25 4
gpt4 key购买 nike

我有一个应该在 AsyncTask 中运行的进度条,但它没有出现,尽管任务运行了

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>

代码:

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

}

最佳答案

我在测试 xD 后忘记打开动画时遇到了这个问题

关于安卓进度条不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7450602/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com