private static void deleteRetryCounter(WeakReference<Context> weakContext,String filename,int maxRetryAttempts){
  Context context=null;
  if (weakContext != null) {
    context=weakContext.get();
    if (context != null) {
      SharedPreferences preferences=context.getSharedPreferences(ARTISAN_SDK,Context.MODE_PRIVATE);
      SharedPreferences.Editor editor=preferences.edit();
      editor.remove("RETRY_COUNT: " + filename);
      editor.apply();
    }
  }
}

private static void deleteRetryCounter ( WeakReference < Context > weakContext , String filename , int maxRetryAttempts ) { Context context = null ; if ( weakContext != null ) { context = weakContext . get ( ) ; if ( context != null ) { SharedPreferences preferences = context . getSharedPreferences ( ARTISAN_SDK , Context . MODE_PRIVATE ) ; SharedPreferences . Editor editor = preferences . edit ( ) ; editor . remove ( "RETRY_COUNT: " + filename ) ; editor . apply ( ) ; } } }
delete the retry counter if stacktrace is uploaded or retry limit is reached .
