Add handler after hotspot details dialog

This commit is contained in:
Adeel Zafar 2019-08-07 16:24:58 +05:00
parent 681742fdb5
commit fa66be3775
3 changed files with 8 additions and 4 deletions

View File

@ -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;
}

View File

@ -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();

View File

@ -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) -> {
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));