【发布时间】:2011-01-26 06:50:13
【问题描述】:
我有一个警报对话框,其中的数据来自互联网。有时由于互联网连接数据来晚了。所以我想要在微调器显示之前进度条。在获取数据时我已经写了这个。
final String[] List= new String{ 'abc', 'def'};
ArrayList<String> ListArray = new ArrayList<String>();
ListArray.addAll(Arrays.asList(List));
ListAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_dropdown_item, ListArray);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Data");
builder.setAdapter(ListAdapter, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
txtExec.setText(ClientList[item]);
}
});
AlertDialog alert = builder.create();
alert.show();
ProgressDialog dialog = new ProgressDialog(this);
dialog.setMessage("Please wait while loading...");
dialog.setIndeterminate(true);
dialog.setCancelable(true);
那么如何在提示对话框之前调整progessDialog呢?
【问题讨论】:
标签: android