Code example for Service

Methods: startForeground

0
 * @author Mikael Kindborg 
 */ 
class StartForegroundWrapper 
{ 
	public void startForeground( 
		Service service, int id, Notification notification)
	{ 
		service.startForeground(id, notification);
	} 
} 
	 
/** 
 * Wrapper class for startForeground, which is not available on 
 * Android versions below level 5. 
 * @author Mikael Kindborg 
 */ 
class StopForegroundWrapper 
{ 
	public void stopForegroundAndRemoveNotificationIcon(Service service)
	{ 
		// The true argument removes the notification icon.