mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 20:54:13 -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()) {
|
switch (intent.getAction()) {
|
||||||
case ACTION_TURN_ON_BEFORE_O:
|
case ACTION_TURN_ON_BEFORE_O:
|
||||||
if (hotspotManager.setWifiEnabled(null, true)) {
|
if (hotspotManager.setWifiEnabled(null, true)) {
|
||||||
//final Handler handler = new Handler();
|
|
||||||
//handler.postDelayed(new Runnable() {
|
|
||||||
// @Override
|
|
||||||
// public void run() {
|
|
||||||
// startServerDialog();
|
|
||||||
// }
|
|
||||||
//}, 6000);
|
|
||||||
|
|
||||||
startHotspotDetails();
|
startHotspotDetails();
|
||||||
updateNotification(getString(R.string.hotspot_running), true);
|
updateNotification(getString(R.string.hotspot_running), true);
|
||||||
}
|
}
|
||||||
|
@ -154,9 +154,22 @@ public class WifiHotspotManager {
|
|||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context, dialogStyle());
|
AlertDialog.Builder builder = new AlertDialog.Builder(context, dialogStyle());
|
||||||
|
|
||||||
builder.setPositiveButton(android.R.string.ok, (dialog, id) -> {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
startServerDialog(context);
|
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));
|
builder.setTitle(context.getString(R.string.hotspot_turned_on));
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
builder.setMessage(
|
builder.setMessage(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user