private void startForegroundCompat(int id,Notification notification){
  if (mStartForeground != null) {
    try {
      mStartForeground.invoke(this,Integer.valueOf(id),notification);
    }
 catch (    InvocationTargetException e) {
      L.d("Unable to invoke startForeground");
    }
catch (    IllegalAccessException e) {
      L.d("Unable to invoke startForeground");
    }
    return;
  }
  if (mSetForeground != null) {
    try {
      mSetForeground.invoke(this,Boolean.TRUE);
    }
 catch (    IllegalAccessException e) {
      L.d("Unable to invoke setForeground");
    }
catch (    InvocationTargetException e) {
      L.d("Unable to invoke setForeground");
    }
  }
  mNM.notify(id,notification);
}

private void startForegroundCompat ( int id , Notification notification ) { if ( mStartForeground != null ) { try { mStartForeground . invoke ( this , Integer . valueOf ( id ) , notification ) ; } catch ( InvocationTargetException e ) { L . d ( "Unable to invoke startForeground" ) ; } catch ( IllegalAccessException e ) { L . d ( "Unable to invoke startForeground" ) ; } return ; } if ( mSetForeground != null ) { try { mSetForeground . invoke ( this , Boolean . TRUE ) ; } catch ( IllegalAccessException e ) { L . d ( "Unable to invoke setForeground" ) ; } catch ( InvocationTargetException e ) { L . d ( "Unable to invoke setForeground" ) ; } } mNM . notify ( id , notification ) ; }
this is a wrapper around the new startforeground method , using the older apis if it is not available .
