Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android 6.0 scan 失敗 #1

Open
turboted opened this issue Sep 21, 2017 · 7 comments
Open

android 6.0 scan 失敗 #1

turboted opened this issue Sep 21, 2017 · 7 comments

Comments

@turboted
Copy link

turboted commented Sep 21, 2017

安裝在android 6.0 平台,會出現要求打開位置
確認打開位置後,scan 回覆還是 0
public void authorized(int requestCode) {
// 6.0 以上系统授权通过
Log.i(TAG, "6.0 Authorized");
if (GET_WIFI_LIST_REQUEST_CODE == requestCode) {
// 获取WIFI列表
List scanResults = mWiFiManager.getScanResults();
refreshData(scanResults);
}
}
跑的是這段系统授权通过,但list 一片空白
android 4.4 可以正常獲取 list

@kongqw
Copy link
Owner

kongqw commented Sep 21, 2017

.getScanResults();是获取扫描结果,授权通过后,先扫描,扫描结束回调以后再调用.getScanResults();试一下呢?

@turboted
Copy link
Author

第一次是直接使用您的apk 進行測試,並沒有修改其內容
這次試著在getScanResults()之前加上mWiFiManager.startScan()
結果是一樣的

        @Override
        public void authorized(int requestCode) {
            // 6.0 以上系统授权通过
            Log.i(TAG, "6.0 Authorized");
            if (GET_WIFI_LIST_REQUEST_CODE == requestCode) {
                // 获取WIFI列表
                mWiFiManager.startScan();
                List<ScanResult> scanResults = mWiFiManager.getScanResults();
                refreshData(scanResults);
            }
        }

@kongqw
Copy link
Owner

kongqw commented Sep 21, 2017

请问,通过下拉刷新,可以获取到数据吗

@turboted
Copy link
Author

turboted commented Sep 21, 2017

因為我是在tv 上測試的,所以沒辦法下拉
不過我看下拉也是調用mWiFiManager.startScan();
權限應該是通過之後才會調用authorized 才是

@kongqw
Copy link
Owner

kongqw commented Sep 21, 2017

TV啊,我也没有再TV上测试过呢,您在6.0的手机设备上有没有问题?
TV的系统应该是定制过的吧?确定一下权限问题,系统有没有改过。

@turboted
Copy link
Author

只借到7.0的手機,安裝完打不開,一開就報錯,kongqw 有什麼好的測試思路嗎,謝謝

@kongqw
Copy link
Owner

kongqw commented Sep 22, 2017

您是用什么手机?看下LOG 打印了什么错误信息呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants