¾È±Ô °øºÎ¹æ

Android > progressDialog

µî·ÏÀÏ : 2017-07-06 17:29 Á¶È¸¼ö : 52,820


 ¾îÇø®ÄÉÀ̼ÇÀÌ µ¿ÀÛÇÏ´Â µµÁß¿¡ ±ä ½Ã°£ÀÇ I/O ÀÛ¾÷À̶ó´øÁö »ç¿ëÀڷκÎÅÍ È®ÀÎ ¸í·ÉÀ» ¹Þ¾Æ¾ß ÇÒ¶§¿Í °°Àº °æ¿ì
ÇöÀç ¿¢Æ¼ºñƼ »ó¿¡ »õ·Î¿î ´ÙÀ̾ó·Î±×¸¦ Ç¥½ÃÇÒ ÇÊ¿ä°¡ ÀÖ´Ù.

ProgressDialog´Â I/O ÀÛ¾÷°ú °°ÀÌ Àá½Ã ¿¢Æ¼ºñÀÌÀÇ »óŸ¦ µ¿°á½Ãų ¶§ »ç¿ëµÇ°í, AlertDialog´Â »ç¿ëÀڷκÎÅÍ È®ÀÎ ¸í·ÉÀ» ¹ÞÀ» ¶§ »ç¿ëµÈ´Ù.
 
	public class MainActivity extends Activity {
		ProgressDialog progressDialog; // ProgressDialog
		
		Button btShowDialog;
		Button btAlert;

		public static int TIME_OUT = 1001;

		protected void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);
			setContentView(R.layout.activity_main);

			btShowDialog = (Button) findViewById(R.id.btShowDialog);
			btAlert = (Button) findViewById(R.id.btShowAlert);
			alertDialog = new AlertDialog.Builder(this);
		}

		public void onClick(View v) {

			// ShowDialog ¹öÆ°ÀÏ Å¬¸¯µÉ ¶§ È£Ãâ
			if (v.getId() == btShowDialog.getId()) {
				// ProgressDialog »ý¼º
				progressDialog = ProgressDialog.show(this, "Title", "Message");

				// Á¤ÇØÁø ½Ã°£ ÈÄ¿¡´Â ŸÀӾƿô ¹ß»ýÀ» À§ÇØ Çڵ鷯·Î ¸Þ½ÃÁö Àü´Þ
				mHandler.sendEmptyMessageDelayed(TIME_OUT, 2000);
			}
		}

		Handler mHandler = new Handler() {
			public void handleMessage(Message msg) {
				if (msg.what == TIME_OUT) {		// ŸÀӾƿôÀÌ ¹ß»ýÇϸé
					progressDialog.dismiss();	// ProgressDialog¸¦ Á¾·á
				}
			}
		};
	}
	


ProgressDialog »ç¿ë¹ý

ProgressDialogÀÇ »ý¼º ¹× Ç¥½Ã´Â Àº ¶óÀÎ 27¹ø°ú °°ÀÌ Ã³¸®ÇÑ´Ù. ¶ÇÇÑ Ç¥½ÃµÈ ProgressDialog°¡ »ç¶óÁú ¼ö ÀÖµµ·Ï Çڵ鷯·Î Áö¿¬µÈ ¸Þ½ÃÁö¸¦ ´øÁø´Ù(¶óÀÎ 30).

Çڵ鷯´Â Áö¿¬µÈ ¸Þ½ÃÁö¸¦ ¹Þ¾Æ¼­ ¶óÀÎ 63,64ó·³ Æ˾÷µÇ¾î ÀÖ´Â ProgressDialog¸¦ »èÁ¦ÇÑ´Ù.


 
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.