久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='ixLu1'></small><noframes id='ixLu1'>

    <bdo id='ixLu1'></bdo><ul id='ixLu1'></ul>

    <tfoot id='ixLu1'></tfoot>
  1. <legend id='ixLu1'><style id='ixLu1'><dir id='ixLu1'><q id='ixLu1'></q></dir></style></legend>
  2. <i id='ixLu1'><tr id='ixLu1'><dt id='ixLu1'><q id='ixLu1'><span id='ixLu1'><b id='ixLu1'><form id='ixLu1'><ins id='ixLu1'></ins><ul id='ixLu1'></ul><sub id='ixLu1'></sub></form><legend id='ixLu1'></legend><bdo id='ixLu1'><pre id='ixLu1'><center id='ixLu1'></center></pre></bdo></b><th id='ixLu1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ixLu1'><tfoot id='ixLu1'></tfoot><dl id='ixLu1'><fieldset id='ixLu1'></fieldset></dl></div>

    1. android webview 地理定位

      android webview geolocation(android webview 地理定位)
        1. <tfoot id='bOXFS'></tfoot>

            1. <i id='bOXFS'><tr id='bOXFS'><dt id='bOXFS'><q id='bOXFS'><span id='bOXFS'><b id='bOXFS'><form id='bOXFS'><ins id='bOXFS'></ins><ul id='bOXFS'></ul><sub id='bOXFS'></sub></form><legend id='bOXFS'></legend><bdo id='bOXFS'><pre id='bOXFS'><center id='bOXFS'></center></pre></bdo></b><th id='bOXFS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bOXFS'><tfoot id='bOXFS'></tfoot><dl id='bOXFS'><fieldset id='bOXFS'></fieldset></dl></div>
                <tbody id='bOXFS'></tbody>

              • <bdo id='bOXFS'></bdo><ul id='bOXFS'></ul>

                <small id='bOXFS'></small><noframes id='bOXFS'>

              • <legend id='bOXFS'><style id='bOXFS'><dir id='bOXFS'><q id='bOXFS'></q></dir></style></legend>
                本文介紹了android webview 地理定位的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我必須在 WebView 中檢索用戶的位置.我使用以下 Javascript 執行此操作:

                I have to retrieve a user's location in a WebView. I do this with the following Javascript:

                function getLocation() {
                   navigator.geolocation.getCurrentPosition(displayLocation, handleError);
                }
                

                但是權限請求彈出窗口永遠不會打開.

                But the permission request popup never opens.

                我已經設置了這些設置:

                I've set these settings:

                ws.setJavaScriptEnabled(true);
                ws.setGeolocationEnabled(true);
                ws.setJavaScriptCanOpenWindowsAutomatically(true);
                

                WebView 中訪問用戶位置的正確方法是什么?

                What is the correct way to access a user's location from within a WebView?

                推薦答案

                • 必須在 WebView 中啟用 JavaScript,使用 WebSettings.setJavaScriptEnabled(true);
                • 應用需要權限ACCESS_FINE_LOCATION
                • WebView 必須使用實現 WebChromeClient.onGeolocationPermissionsShowPrompt() 的自定義 WebChromeClient.這種方法由 WebView 調用以獲取向 JavaScript 公開用戶位置的權限.(在瀏覽器的情況下,我們向用戶顯示一個提示.)默認實現什么都不做,所以永遠不會獲得許可,也永遠不會將位置傳遞給 JavaScript.始終授予權限的簡單實現是...

                  • JavaScript must be enabled in the WebView, using WebSettings.setJavaScriptEnabled(true);
                  • The app needs permission ACCESS_FINE_LOCATION
                  • The WebView must use a custom WebChromeClient which implements WebChromeClient.onGeolocationPermissionsShowPrompt(). This method is called by the WebView to obtain permission to disclose the user's location to JavaScript. (In the case of the browser, we show a prompt to the user.) The default implementation does nothing, so permission is never obtained and the location is never passed to JavaScript. A simple implementation which always grants permission is ...

                    webView.setWebChromeClient(new WebChromeClient() {
                     public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
                        callback.invoke(origin, true, false);
                     }
                    });
                    

                  • 地理定位使用數據庫在會話之間保持緩存的位置和權限.使用 WebSettings.setGeolocationDatabasePath(...) 設置數據庫的位置.如果未設置數據庫的位置,則持久存儲將不可用,但 Geolocation 將繼續正常運行,否則.要設置數據庫的位置,請使用 ...

                    Geolocation uses databases to persist cached positions and permissions between sessions. The location of the database is set using WebSettings.setGeolocationDatabasePath(...). If the location of the database is not set, the persistent storage will not be available, but Geolocation will continue to function correctly otherwise. To set the location of the databases, use ...

                    webView.getSettings().setGeolocationDatabasePath( context.getFilesDir().getPath() );
                    

                    這篇關于android webview 地理定位的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                    【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Help calculating X and Y from Latitude and Longitude in iPhone(幫助從 iPhone 中的緯度和經度計算 X 和 Y)
                Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                CLLocation returning negative speed(CLLocation 返回負速度)
                How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網絡提供商)

                1. <i id='yrwqJ'><tr id='yrwqJ'><dt id='yrwqJ'><q id='yrwqJ'><span id='yrwqJ'><b id='yrwqJ'><form id='yrwqJ'><ins id='yrwqJ'></ins><ul id='yrwqJ'></ul><sub id='yrwqJ'></sub></form><legend id='yrwqJ'></legend><bdo id='yrwqJ'><pre id='yrwqJ'><center id='yrwqJ'></center></pre></bdo></b><th id='yrwqJ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yrwqJ'><tfoot id='yrwqJ'></tfoot><dl id='yrwqJ'><fieldset id='yrwqJ'></fieldset></dl></div>

                  <small id='yrwqJ'></small><noframes id='yrwqJ'>

                      <tbody id='yrwqJ'></tbody>

                        <bdo id='yrwqJ'></bdo><ul id='yrwqJ'></ul>
                      • <tfoot id='yrwqJ'></tfoot>
                      • <legend id='yrwqJ'><style id='yrwqJ'><dir id='yrwqJ'><q id='yrwqJ'></q></dir></style></legend>

                          主站蜘蛛池模板: 色天堂影院 | 免费在线黄| 天天干亚洲 | 一区二区免费看 | 日韩在线综合 | 亚洲精品一区二区三区四区高清 | 无吗视频| 人人人人人爽 | 国产精品欧美一区二区三区不卡 | h在线| 色精品| 欧美一区二区三区精品 | 一级一级毛片免费看 | 夜夜草av | 亚洲激情在线观看 | 成人毛片一区二区三区 | 欧美亚洲第一区 | 欧美精品一区二区在线观看 | 亚洲日本一区二区三区四区 | 国产精品一区二区无线 | 免费成人高清 | 国产午夜精品久久 | 羞羞视频在线观看网站 | 国产一区二区精品自拍 | 97超碰成人 | 在线免费国产视频 | 国产一区二区三区日韩 | 91av在线视频观看 | 日本一区二区三区四区 | 高清成人av | 美国a级毛片免费视频 | 成人深夜小视频 | 中文字幕亚洲在线 | 精品久久久久久久久久久久久 | 国产成人精品a视频 | 一区二区三区四区不卡视频 | 特黄一级| 国产大片黄色 | 看毛片网站 | 久久久999成人 | 古装三级在线播放 |