Code example for Service

Methods: stopForeground

0
            mCurrentService.startForeground(id, mNotification);
        } 
 
        public void stopForeground() 
        { 
            mCurrentService.stopForeground(true);
        } 
    } 
     
    private class OldForegroundApi implements IRunForeground 
    { 
        /*  
         * Get the new API through reflection because it's unavailable  
         * in honeycomb 
         */ 
        private Method mSetForeground;
 
        public OldForegroundApi() throws SecurityException, NoSuchMethodException 
        { 
            mSetForeground = getClass().getMethod("setForeground",
                    new Class[] { boolean.class });