티스토리 뷰



안드로이드/Android TimePiker 사용하기 ~ !

 
/**
	 * TimePiker 시/분
	 */
	private void DialogTimePicker(){
		TimePickerDialog.OnTimeSetListener mTimeSetListener = 
				new TimePickerDialog.OnTimeSetListener() {
			public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
				calendar.set(Calendar.HOUR_OF_DAY, hourOfDay);
				calendar.set(Calendar.MINUTE, minute);
				Toast.makeText(BSMeasureActivity.this,
						"Time is=" + hourOfDay + ":" + minute, Toast.LENGTH_SHORT)
						.show();
			}
		};
		TimePickerDialog alert = new TimePickerDialog(this, 
				mTimeSetListener, 
				calendar.get(Calendar.HOUR_OF_DAY),
				calendar.get(Calendar.MINUTE),
				false); 
		alert.show();
	} 

아래는 TimePiker 메서드 실행 화면 입니다.





댓글
댓글쓰기 폼