diff --git a/app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostActivity.java b/app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostActivity.java index 2a3fb6152..d2696b23e 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostActivity.java +++ b/app/src/main/java/org/kiwix/kiwixmobile/webserver/ZimHostActivity.java @@ -16,7 +16,6 @@ import android.view.KeyEvent; import android.view.View; import android.widget.Button; import android.widget.TextView; -import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; @@ -141,7 +140,7 @@ public class ZimHostActivity extends AppCompatActivity implements method.setAccessible(true); enabled = (Boolean) method.invoke(cm); } catch (Exception e) { - Log.e("TAG", e.toString()); + Log.e("ZimHostActivity", e.toString()); } return enabled; } diff --git a/app/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotService.java b/app/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotService.java index f4fffad2b..e9750dd02 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotService.java +++ b/app/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/HotspotService.java @@ -140,7 +140,6 @@ public class HotspotService extends Service { @RequiresApi(api = Build.VERSION_CODES.O) public static boolean checkHotspotState(Context context) { if (hotspotManager == null) { - Log.v("TAG", "hotspotManager initialized"); hotspotManager = new WifiHotspotManager(context); } return hotspotManager.checkHotspotState(); diff --git a/app/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/WifiHotspotManager.java b/app/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/WifiHotspotManager.java index 8b29c4d12..aee7da43b 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/WifiHotspotManager.java +++ b/app/src/main/java/org/kiwix/kiwixmobile/wifi_hotspot/WifiHotspotManager.java @@ -95,7 +95,13 @@ public class WifiHotspotManager { AlertDialog.Builder builder = new AlertDialog.Builder(context, dialogStyle()); WebServerHelper webServerHelper = new WebServerHelper(context); builder.setPositiveButton(android.R.string.ok, (dialog, id) -> { - webServerHelper.startServerHelper(); + final Handler handler = new Handler(); + handler.postDelayed(new Runnable() { + @Override + public void run() { + webServerHelper.startServerHelper(); + } + }, 2500); }); builder.setTitle(context.getString(R.string.hotspot_turned_on));