private void stopForegroundCompat(int id){
  if (mStopForeground != null) {
    try {
      mStopForeground.invoke(this,Boolean.TRUE);
    }
 catch (    InvocationTargetException e) {
      L.d("Unable to invoke stopForeground");
    }
catch (    IllegalAccessException e) {
      L.d("Unable to invoke stopForeground");
    }
    return;
  }
  mNM.cancel(id);
  if (mSetForeground != null) {
    try {
      mSetForeground.invoke(this,Boolean.FALSE);
    }
 catch (    IllegalAccessException e) {
      L.d("Unable to invoke setForeground");
    }
catch (    InvocationTargetException e) {
      L.d("Unable to invoke setForeground");
    }
  }
}

private void stopForegroundCompat ( int id ) { if ( mStopForeground != null ) { try { mStopForeground . invoke ( this , Boolean . TRUE ) ; } catch ( InvocationTargetException e ) { L . d ( "Unable to invoke stopForeground" ) ; } catch ( IllegalAccessException e ) { L . d ( "Unable to invoke stopForeground" ) ; } return ; } mNM . cancel ( id ) ; if ( mSetForeground != null ) { try { mSetForeground . invoke ( this , Boolean . FALSE ) ; } catch ( IllegalAccessException e ) { L . d ( "Unable to invoke setForeground" ) ; } catch ( InvocationTargetException e ) { L . d ( "Unable to invoke setForeground" ) ; } } }
this is a wrapper around the new stopforeground method , using the older apis if it is not available .
