diff --git a/applicationinsights-android/src/main/java/com/microsoft/applicationinsights/library/Sender.java b/applicationinsights-android/src/main/java/com/microsoft/applicationinsights/library/Sender.java index a32aa67..35a1c12 100644 --- a/applicationinsights-android/src/main/java/com/microsoft/applicationinsights/library/Sender.java +++ b/applicationinsights-android/src/main/java/com/microsoft/applicationinsights/library/Sender.java @@ -164,11 +164,12 @@ protected void sendRequestWithPayload(String payload, File fileToSend) throws IO try { if(ApplicationInsights.isDeveloperMode()) { InternalLogging.info(TAG, "Logging payload", payload); - writer = getWriter(connection); - writer.write(payload); - writer.flush(); } + writer = getWriter(connection); + writer.write(payload); + writer.flush(); + // Starts the query connection.connect();