Code example for Time

Methods: afterbefore

0
		 
		final Calendar mCalendar=Calendar.getInstance();
        int mHour=mCalendar.get(Calendar.HOUR_OF_DAY);
        int mMinuts=mCalendar.get(Calendar.MINUTE);
         
        Time thisTime = new Time();
        thisTime.hour = mHour;
        thisTime.minute = mMinuts;
		 
        if (this.busEnd.after(this.busStart)) {
        	//For bus at day time 
			if (thisTime.after(this.busStart)
					&&thisTime.before(this.busEnd)) {
				Log.v(TAG, "Is Valid Time");
				return true; 
			} 
        } else { 
        	//For bus at night time 
        	if (thisTime.after(this.busStart)
					||thisTime.before(this.busEnd)) {
				Log.v(TAG, "Is Valid Time");
				return true; 
			} 
        } 
 
Contextual code suggestions in your IDE  Get Codota for Java