Check if mobile data is enabled for API<26

This commit is contained in:
Adeel Zafar 2019-08-02 02:18:03 +05:00
parent e41589af16
commit 9b04bea2b1

View File

@ -960,7 +960,11 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
toggleHotspot(); toggleHotspot();
} else { } else {
//TO DO: show Dialog() + within that add check mobile Data check later. //TO DO: show Dialog() + within that add check mobile Data check later.
startHotspotDialog(); if (isMobileDataEnabled(this)) {
mobileDataDialog();
} else {
startHotspotDialog();
}
} }
} }
default: default:
@ -1138,6 +1142,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
builder.setPositiveButton(this.getString(R.string.yes), (dialog, id) -> disableMobileData()); builder.setPositiveButton(this.getString(R.string.yes), (dialog, id) -> disableMobileData());
builder.setNegativeButton((android.R.string.no), (dialog, id) -> { builder.setNegativeButton((android.R.string.no), (dialog, id) -> {
startHotspotDialog();
}); });
builder.setTitle(this.getString(R.string.mobile_data_enabled)); builder.setTitle(this.getString(R.string.mobile_data_enabled));
builder.setMessage( builder.setMessage(