mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 12:42:56 -04:00
Add delay before start server dialog for devices < O
This commit is contained in:
parent
2e0da70bf4
commit
eefeaed069
@ -64,14 +64,6 @@ public class HotspotService extends Service {
|
||||
switch (intent.getAction()) {
|
||||
case ACTION_TURN_ON_BEFORE_O:
|
||||
if (hotspotManager.setWifiEnabled(null, true)) {
|
||||
//final Handler handler = new Handler();
|
||||
//handler.postDelayed(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// startServerDialog();
|
||||
// }
|
||||
//}, 6000);
|
||||
|
||||
startHotspotDetails();
|
||||
updateNotification(getString(R.string.hotspot_running), true);
|
||||
}
|
||||
|
@ -154,9 +154,22 @@ public class WifiHotspotManager {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context, dialogStyle());
|
||||
|
||||
builder.setPositiveButton(android.R.string.ok, (dialog, id) -> {
|
||||
startServerDialog(context);
|
||||
});
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
builder.setPositiveButton(android.R.string.ok, (dialog, id) -> {
|
||||
startServerDialog(context);
|
||||
});
|
||||
} else {
|
||||
builder.setPositiveButton(android.R.string.ok, (dialog, id) -> {
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
startServerDialog(context);
|
||||
}
|
||||
}, 6000);
|
||||
});
|
||||
}
|
||||
|
||||
builder.setTitle(context.getString(R.string.hotspot_turned_on));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
builder.setMessage(
|
||||
|
Loading…
x
Reference in New Issue
Block a user