Code example for Formatter

Methods: close, format

0
	 * @param time the time to format, in milliseconds 
	 * @return a string containing the formatted time 
	 */ 
	protected static String formatTime(long time) {
		StringBuffer output = new StringBuffer();
		Formatter formatter = new Formatter(output);
		formatter.format("%tY-%tm-%td %tT", time, time, time, time);
		formatter.close();
		return output.toString();
	} 
 
	protected void requestNow() { 
		setRequestPending(true); 
		new WotdTask(this).execute();
	} 
 
	protected void startRerequesting() { 
		// begin rechecking every 15 minutes 
		Intent serviceIntent = new Intent(getApplicationContext(), DubsarService.class);
		PendingIntent pendingIntent = PendingIntent.getService(this, 0, serviceIntent, 0);
		AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);