效果图:
public class Login extends Activity {
private Button btn_login;
private ProgressDialog pd;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
btn_login=(Button) findViewById(R.id.btn_login);
btn_login.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
// Toast.makeText(Login.this, edt_username.getText().toString(), Toast.LENGTH_SHORT).show();
pd = new ProgressDialog(Login.this);
pd.setMessage("正在查询,请稍后...");
pd.setIndeterminate(true);
pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pd.show();
}
});
王立平--ProgressDialog
原文:http://blog.csdn.net/u013425527/article/details/40145943