Code example for ProgressDialog

Methods: setTitlesetMessagesetProgressStyle, show

0
        Thread thread = new Thread(new MockForSpinner());
        thread.start();
    } 
 
    public void onHorizontalClick(View view) {
        mProgressDialog = new ProgressDialog(this);
        mProgressDialog.setTitle("通信中");
        mProgressDialog.setMessage("しばらくお待ちください");
        mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
        mProgressDialog.show();
 
        Thread thread = new Thread(new MockForHorizontal());
        thread.start();
    } 
 
    private class MockForSpinner implements Runnable {
 
        public void run() { 
            try { 
                // 時間のかかる処理のつもりで 
                // 5秒スリープ