Android之android8.1打开热点提示UID 10140 does not have Location permission和Location mode is enabled.
发布日期:2021-06-29 13:55:25 浏览次数:2 分类:技术文章

本文共 913 字,大约阅读时间需要 3 分钟。

1 问题

在三星安卓8.1版本手机上,打开热点

WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);            wifiManager.startLocalOnlyHotspot(new WifiManager.LocalOnlyHotspotCallback() {                @TargetApi(Build.VERSION_CODES.O)                @Override                public void onStarted(WifiManager.LocalOnlyHotspotReservation reservation) {                    super.onStarted(reservation);                    mReservation = reservation;                    WifiConfiguration wifiConfiguration = reservation.getWifiConfiguration();                    ssid = wifiConfiguration.SSID;                    mHandler.obtainMessage(2018, wifiConfiguration).sendToTarget();                }                @Override                public void onStopped() {                    super.onStopped();                }                @Override                public void onFailed(int reas

转载地址:https://chenyu.blog.csdn.net/article/details/105719974 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Android之ScrollView设置了高度(android:layout_height=“match_parent“)但里面的组件不能充满问题
下一篇:Android之用java的socket写服务器提示java.net.BindException: Address already in use

发表评论

最新留言

关注你微信了!
[***.104.42.241]2024年04月13日 03时33分31秒