Saturday, June 19, 2010

在Android程序里显示等待滚动圈(使用ProgressDialog)| Show waiting rolling circle in android application (using ProgressDialog)

see the effect in attached file.

Code here:

package com.sina.android.acx;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;

public class AClientXActivity extends Activity {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ProgressDialog dialog = new ProgressDialog(this);
        dialog.setMessage("Please wait while loading...");
        dialog.setIndeterminate(true);
        dialog.setCancelable(true);
        dialog.show();
    }
}

No comments: