mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-25 14:02:36 -04:00
Add handler after hotspot details dialog
This commit is contained in:
parent
681742fdb5
commit
fa66be3775
@ -16,7 +16,6 @@ import android.view.KeyEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
@ -141,7 +140,7 @@ public class ZimHostActivity extends AppCompatActivity implements
|
|||||||
method.setAccessible(true);
|
method.setAccessible(true);
|
||||||
enabled = (Boolean) method.invoke(cm);
|
enabled = (Boolean) method.invoke(cm);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("TAG", e.toString());
|
Log.e("ZimHostActivity", e.toString());
|
||||||
}
|
}
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,6 @@ public class HotspotService extends Service {
|
|||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
public static boolean checkHotspotState(Context context) {
|
public static boolean checkHotspotState(Context context) {
|
||||||
if (hotspotManager == null) {
|
if (hotspotManager == null) {
|
||||||
Log.v("TAG", "hotspotManager initialized");
|
|
||||||
hotspotManager = new WifiHotspotManager(context);
|
hotspotManager = new WifiHotspotManager(context);
|
||||||
}
|
}
|
||||||
return hotspotManager.checkHotspotState();
|
return hotspotManager.checkHotspotState();
|
||||||
|
@ -95,7 +95,13 @@ public class WifiHotspotManager {
|
|||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context, dialogStyle());
|
AlertDialog.Builder builder = new AlertDialog.Builder(context, dialogStyle());
|
||||||
WebServerHelper webServerHelper = new WebServerHelper(context);
|
WebServerHelper webServerHelper = new WebServerHelper(context);
|
||||||
builder.setPositiveButton(android.R.string.ok, (dialog, id) -> {
|
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));
|
builder.setTitle(context.getString(R.string.hotspot_turned_on));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user