【发布时间】:2012-03-28 15:52:33
【问题描述】:
我有一个方法是从服务器列出我的项目。因此,此方法需要时间才能获得所有项目。所以我想用 ProgressDialog 来等待这个方法。我阅读了一些模块,但找不到任何有用的解决方案。
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// setContentView(R.layout.main;
loginScreen();
}
public boolean getItems() throws MessagingException
{
items receiving here
}
public void loginScreen()
{
setContentView(R.layout.main);
Button loginBtn = (Button) findViewById(R.id.btnLogin);
loginBtn.setOnClickListener(new Button.OnClickListener()
{
public void onClick(View arg0)
{
getItems();
}
}
}
打开按钮单击我调用接收所有项目的方法。当我单击按钮时,我想显示一个进度条,直到所有项目都获得为止。
【问题讨论】:
标签: android timer progressdialog countdowntimer postdelayed