From da4c2192505b4886b5a28a568448cc6bb413ff74 Mon Sep 17 00:00:00 2001 From: Teclib Date: Fri, 8 Apr 2022 14:17:38 +0200 Subject: [PATCH] fix(share): fix file path Signed-off-by: Teclib --- .../main/java/org/glpi/inventory/agent/utils/Helpers.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/glpi/inventory/agent/utils/Helpers.java b/app/src/main/java/org/glpi/inventory/agent/utils/Helpers.java index 70fee4d1c..14f6d2e4d 100644 --- a/app/src/main/java/org/glpi/inventory/agent/utils/Helpers.java +++ b/app/src/main/java/org/glpi/inventory/agent/utils/Helpers.java @@ -37,6 +37,7 @@ import android.app.Activity; import android.app.ActivityManager; +import android.app.Application; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; @@ -184,15 +185,14 @@ public static void share(Context context, String message, final int type){ final InventoryTask inventoryTask = new InventoryTask(context, "", true); String path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath(); if(type == 1){ - - File file = new File(path+ "/Inventory.json"); + File file = new File(context.getFilesDir(), "Inventory.json"); if(file.exists()){ inventoryTask.shareInventory(type); }else{ AgentLog.e("JSON File not exist"); } }else{ - File file = new File(path+ "/Inventory.xml"); + File file = new File(context.getFilesDir(), "Inventory.xml"); if(file.exists()){ inventoryTask.shareInventory(type); }else{