:net::ERR_UNKNOWN__URL_SCHEME

Discussion:
(too old to reply)
Raw Message
Hello,I'm trying to install an APk right after the download is completed. The APk gets open with the browser and throws ERR_UNKNOWN_URL_SCHEME. I'm assuming the the device thinks the downloaded file needs to be open with the browser instead of the android application installer.package com.example.alien.import android.content.Cimport android.os.Bimport android.support.v7.app.AppCompatAimport java.io.Fimport java.io.FileInputSimport java.io.FileNotFoundEimport java.io.IOEimport org.json.JSONAimport org.json.JSONEimport org.json.JSONOimport android.app.DownloadMimport android.net.Uimport android.os.Bimport android.os.Eimport android.os.ParcelFileDimport android.app.Aimport android.app.DownloadMimport android.app.DownloadManager.Qimport android.content.BroadcastRimport android.content.Cimport android.content.Iimport android.content.IntentFimport android.database.Cimport android.view.Gimport android.view.Mimport android.view.Vimport android.view.View.OnClickLimport android.widget.Bimport android.widget.TextVimport android.widget.Tpublic class MainActivity extends AppCompatActivity implements View.OnClickListener {private DownloadManager downloadMprivate long downloadR@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);//start download buttonButton startDownload = (Button) findViewById(R.id.startDownload);startDownload.setOnClickListener(this);//set filter to only when download is complete and register broadcast receiverIntentFilter filter = new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE);registerReceiver(downloadReceiver, filter);}public void onClick(View v) {System.out.println(v);switch (v.getId()) {//start the download processcase R.id.startDownload:downloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);Uri Download_Uri = Uri.parse("http://45.63.4.194/es.apk");DownloadManager.Request request = new DownloadManager.Request(Download_Uri);//Set a description of this download, to be displayed in notifications (if enabled)request.setDescription("Android Data download using DownloadManager.");//Set the local destination for the downloaded file to a path within the application's external files directoryrequest.setDestinationInExternalFilesDir(this, null, "es.apk");//Enqueue a new download and same the referenceIddownloadReference = downloadManager.enqueue(request);}}private BroadcastReceiver downloadReceiver = new BroadcastReceiver() {@Overridepublic void onReceive(Context context, Intent intent) {long referenceId = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1);if(downloadReference == referenceId) {DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(dm.getUriForDownloadedFile(referenceId),dm.getMimeTypeForDownloadedFile(referenceId));startActivity(intent);}}};}--You received this message because you are subscribed to the Google Groups "Android Developers" group.To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+***@googlegroups.com.To post to this group, send email to android-***@googlegroups.com.Visit this group at https://groups.google.com/group/android-developers.To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/12abf589-ae2d-4904-bc5f-f941c5fdb119%40googlegroups.com.For more options, visit https://groups.google.com/d/optout.
Raw Message
Have you declared the redirect uri in the manifest?Hello,I'm trying to install an APk right after the download is completed. The APk gets open with the browser and throws ERR_UNKNOWN_URL_SCHEME. I'm assuming the the device thinks the downloaded file needs to be open with the browser instead of the android application installer.package com.example.alien.import android.content.Cimport android.os.Bimport android.support.v7.app.AppCompatAimport java.io.Fimport java.io.FileInputSimport java.io.FileNotFoundEimport java.io.IOEimport org.json.JSONAimport org.json.JSONEimport org.json.JSONOimport android.app.DownloadMimport android.net.Uimport android.os.Bimport android.os.Eimport android.os.ParcelFileDimport android.app.Aimport android.app.DownloadMimport android.app.DownloadManager.Qimport android.content.BroadcastRimport android.content.Cimport android.content.Iimport android.content.IntentFimport android.database.Cimport android.view.Gimport android.view.Mimport android.view.Vimport android.view.View.OnClickLimport android.widget.Bimport android.widget.TextVimport android.widget.Tpublic class MainActivity extends AppCompatActivity implements View.OnClickListener {private DownloadManager downloadMprivate long downloadR@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);//start download buttonButton startDownload = (Button) findViewById(R.id.startDownload);startDownload.setOnClickListener(this);//set filter to only when download is complete and register broadcast receiverIntentFilter filter = new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE);registerReceiver(downloadReceiver, filter);}public void onClick(View v) {System.out.println(v);switch (v.getId()) {//start the download processdownloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);Uri Download_Uri = Uri.parse("http://45.63.4.194/es.apk");DownloadManager.Request request = new DownloadManager.Request(Download_Uri);//Set a description of this download, to be displayed in notifications (if enabled)request.setDescription("Android Data download using DownloadManager.");//Set the local destination for the downloaded file to a path within the application's external files directoryrequest.setDestinationInExternalFilesDir(this, null, "es.apk");//Enqueue a new download and same the referenceIddownloadReference = downloadManager.enqueue(request);}}private BroadcastReceiver downloadReceiver = new BroadcastReceiver() {@Overridepublic void onReceive(Context context, Intent intent) {long referenceId = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1);if(downloadReference == referenceId) {DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(dm.getUriForDownloadedFile(referenceId),dm.getMimeTypeForDownloadedFile(referenceId));startActivity(intent);}}};}--You received this message because you are subscribed to the Google Groups "Android Developers" group.To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+***@googlegroups.com.To post to this group, send email to android-***@googlegroups.com.Visit this group at https://groups.google.com/group/android-developers.To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/dac49bc9-c048-488f-bb7e-2bce70f37eba%40googlegroups.com.For more options, visit https://groups.google.com/d/optout.
Raw Message
How do I do the redirect ?Have you declared the redirect uri in the manifest??EUR?· ? ?±???±?????u???(R), 8 ???±?oe?????±???????? 2016 - 2:44:39 ?OE.?OE. UTC+2, ?? ?????(R)?????·?? JeffHello,I'm trying to install an APk right after the download is completed. The APk gets open with the browser and throws ERR_UNKNOWN_URL_SCHEME. I'm assuming the the device thinks the downloaded file needs to be open with the browser instead of the android application installer.package com.example.alien.import android.content.Cimport android.os.Bimport android.support.v7.app.AppCompatAimport java.io.Fimport java.io.FileInputSimport java.io.FileNotFoundEimport java.io.IOEimport org.json.JSONAimport org.json.JSONEimport org.json.JSONOimport android.app.DownloadMimport android.net.Uimport android.os.Bimport android.os.Eimport android.os.ParcelFileDimport android.app.Aimport android.app.DownloadMimport android.app.DownloadManager.Qimport android.content.BroadcastRimport android.content.Cimport android.content.Iimport android.content.IntentFimport android.database.Cimport android.view.Gimport android.view.Mimport android.view.Vimport android.view.View.OnClickLimport android.widget.Bimport android.widget.TextVimport android.widget.Tpublic class MainActivity extends AppCompatActivity implements View.OnClickListener {private DownloadManager downloadMprivate long downloadR@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);//start download buttonButton startDownload = (Button) findViewById(R.id.startDownload);startDownload.setOnClickListener(this);//set filter to only when download is complete and register broadcast receiverIntentFilter filter = new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE);registerReceiver(downloadReceiver, filter);}public void onClick(View v) {System.out.println(v);switch (v.getId()) {//start the download processdownloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);Uri Download_Uri = Uri.parse("http://45.63.4.194/es.apk");DownloadManager.Request request = new DownloadManager.Request(Download_Uri);//Set a description of this download, to be displayed in notifications (if enabled)request.setDescription("Android Data download using DownloadManager.");//Set the local destination for the downloaded file to a path within the application's external files directoryrequest.setDestinationInExternalFilesDir(this, null, "es.apk");//Enqueue a new download and same the referenceIddownloadReference = downloadManager.enqueue(request);}}private BroadcastReceiver downloadReceiver = new BroadcastReceiver() {@Overridepublic void onReceive(Context context, Intent intent) {long referenceId = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1);if(downloadReference == referenceId) {DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(dm.getUriForDownloadedFile(referenceId),dm.getMimeTypeForDownloadedFile(referenceId));startActivity(intent);}}};}--You received this message because you are subscribed to a topic in theGoogle Groups "Android Developers" group.To unsubscribe from this topic, visithttps://groups.google.com/d/topic/android-developers/JsubnhbVGjY/unsubscribe.To unsubscribe from this group and all its topics, send an email to.Visit this group at https://groups.google.com/group/android-developers.To view this discussion on the web visithttps://groups.google.com/d/msgid/android-developers/dac49bc9-c048-488f-bb7e-2bce70f37eba%40googlegroups.com&https://groups.google.com/d/msgid/android-developers/dac49bc9-c048-488f-bb7e-2bce70f37eba%40googlegroups.com?utm_medium=email&utm_source=footer&.For more options, visit https://groups.google.com/d/optout.--You received this message because you are subscribed to the Google Groups "Android Developers" group.To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+***@googlegroups.com.To post to this group, send email to android-***@googlegroups.com.Visit this group at https://groups.google.com/group/android-developers.To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/CACO9cMLENH6rq1Cf%2B_WQpphSk874BKeDdbk9yJfO2FuCpyorvQ%40mail.gmail.com.For more options, visit https://groups.google.com/d/optout.
Loading...&nbsp>&nbsp
&nbsp>&nbsp
&nbsp>&nbsp
【完美解决】WebView网页中使用到支付宝调不起来,提示ERR_UNKNOWN_URL_SCHEME
摘要:在WebView中如果使用到支付宝,需要添加以下代码,否则操作系统会将支付宝的URL拦截,导致你打不开支付宝页面。webView.setWebViewClient(newWebViewClient(){@OverridepublicbooleanshouldOverrideUrlLoading(WebViewview,Stringurl){if(url.startsWith(&http:&)||url.startsWith(&https:&quo
在WebView中如果使用到支付宝,需要添加以下代码,否则操作系统会将支付宝的URL拦截,导致你打不开支付宝页面。
webView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url.startsWith(&http:&) || url.startsWith(&https:&)) { } try { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(intent); } catch (Exception e) { } } });
这里要注意的是上面需要加下try catch,因为你传过来的url并不一定是合法的。有可能是打开本地app的url,如果你没有安装,是会导致崩溃的。
以上是的内容,更多
的内容,请您使用右上方搜索功能获取相关信息。
若你要投稿、删除文章请联系邮箱:zixun-group@service.aliyun.com,工作人员会在五个工作日内给你回复。
新用户大礼包!
现在注册,免费体验40+云产品,及域名优惠!
云服务器 ECS
可弹性伸缩、安全稳定、简单易用
&40.8元/月起
预测未发生的攻击
&24元/月起
你可能还喜欢
你可能感兴趣
阿里云教程中心为您免费提供
【完美解决】WebView网页中使用到支付宝调不起来,提示ERR_UNKNOWN_URL_SCHEME相关信息,包括
的信息,所有【完美解决】WebView网页中使用到支付宝调不起来,提示ERR_UNKNOWN_URL_SCHEME相关内容均不代表阿里云的意见!投稿删除文章请联系邮箱:zixun-group@service.aliyun.com,工作人员会在五个工作日内答复
售前咨询热线
支持与服务
资源和社区
关注阿里云
International进来开发需要,欲于app中加入百度地图导航功能,然时间紧迫,遂以嵌入网页为先。
然在使用webView加载网页过程中,遇到了如上问题,显示ERR_UNKNOWN_URL_SCHEME
不知何故之下,学网上删去webView.setWebViewClient(new WebViewClient(){...},并加上webView.setWebChromeClient(new WebChromeClient());的确可以正确显示了,但是尝试后,发现点击链接会自动跳转手机浏览器,而不继续在这儿显示了,这显然不是我所希望的。
但是想让网页只在我的webview内跳转,而不要跑到手机浏览器去了,那么就需要用到如下代码:
webView.setWebViewClient(new WebViewClient(){
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
是的,这正是前面删掉的嘛,而且只要加了这东西,即便加上webView.setWebChromeClient(new WebChromeClient()); 也是无用,一样的报错。
难道无解了吗?不不不,上述方法既不治标也不治本,而真正治本的方法如下:
首先我们观察一下错误显示:
发现了吗,位于baidumap://xxx 的网页无法加载,明明输入的是http://xxx 为何变成了这个开头?
这是因为其自定义了scheme,类似的还有alipays://,weixin:// 等等。而webView只能识别http://或https://开头的url,因此才会报此错。
想处理也很简单,对于这种自定义scheme的url单独处理即可。
以我的baidumap://为例,修改代码如下:
webView.setWebViewClient(new WebViewClient(){
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if(url.startsWith("baidumap://")){
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
return true;
}catch (Exception e){
return false;
webView.loadUrl(url);
return true;
另外那个webView.setWebChromeClient(new WebChromeClient()); 得删去啦。
上述是只针对以baidumap:// 开头的scheme,如果当前页面显示的网站是固定的,那么也如此操作即可,而如果需要做成一个类似浏览器的形式,只需判断开头是否是http://或https:// ,如若不是,则将上面的try...catch中代码复制进去,删去if判断即可。
欢迎大家加入QQ群一起交流讨论,——YinyouPoet
WebView出现net::ERR_UNKNOWN_URL_SCHEME错误
webview加载网页出现(&找不到网页net:err_unknown_url_scheme&)
网页打开Android app ERR_UNKNOWN_URL_SCHEME 问题解决
android webview ERR_UNKNOWN_URL_SCHEME
解决Webview显示提示 err_unknown_url_scheme
【Android基础】webview加载网页出现(&找不到网页net:err_unknown_url_scheme&)
Android:WebView加载url网页显示不完整解决办法
没有更多推荐了,错误代码: ERR_UNKNOWN_URL_SCHEME 是什么意思啊 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
已注册用户请 &
· 在 Chrome 里使用 vim 快捷键
错误代码: ERR_UNKNOWN_URL_SCHEME 是什么意思啊
23:08:57 +08:00用 Android 发布 · 18373 次点击
无法显示此网页隐藏详细信息网址为 thunder://QUFodHRwOi8vMTIxLjQwLjEzNi43L2Rvd25sb2FkL3QxV2dqelp3SmNHc3hEaGdSWDBjREh5clFlRlI2TUUsZTkwQlVOMjhPQ0swOG5MZzVpVV94aU9ISEJFWEhCRm1JT3FVN3MwTDlPWGshLzExZWY0ZDQzMWFjODllNWY2ZmJkMTU0NzNmMDg4NmQ0LnRvcnJlbnRaWg== 的网页可能暂时无法连接,或者它已永久性地移动到了新网址。错误代码:ERR_UNKNOWN_URL_SCHEME
4 回复 &| &直到
02:06:53 +08:00
& & 23:10:12 +08:00
& & 23:11:55 +08:00
UNKNOWN URL SCHEME
& & 01:24:21 +08:00
简单的来说,没安装迅雷找一个链接转换工具吧
& & 02:06:53 +08:00
迅雷地址不是 base64 编码么http://121.40.136.7/download/t1WgjzZwJcGsxDhgRX0cDHyrQeFR6ME,e90BUN28OCK08nLg5iU_xiOHHBEXHBFmIOqU7s0L9OXk!/11ef4d431ac89e5f6fbdd4.torrent
& · & 1781 人在线 & 最高记录 3762 & · &
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.1 · 16ms · UTC 05:56 · PVG 13:56 · LAX 22:56 · JFK 01:56? Do have faith in what you're doing.angularjs - Getting net::ERR_UNKNOWN_URL_SCHEME while calling telephone number with ionic - Stack Overflow
to customize your list.
This site uses cookies to deliver our services and to show you relevant ads and job listings.
By using our site, you acknowledge that you have read and understand our , , and our .
Your use of Stack Overflow’s Products and Services, including the Stack Overflow Network, is subject to these policies and terms.
Join Stack Overflow to learn, share knowledge, and build your career.
or sign in with
I have this code in config.xml
&content src="index.html"/&
&access origin="*"/&
&allow-navigation href="tel:*" /&
&allow-intent href="tel:*"/&
&allow-intent href="mailto:*"/&
&allow-intent href="http://*/*"/&
&allow-navigation href="tel:*"/&
&allow-navigation href="http://*/*"/&
&allow-navigation href="https://*/*"/&
&access origin="mailto:*" launch-external="true" /&
&access origin="tel:*" launch-external="true" /&
This in HTML:
&a ng-href="tel:{{item.phone}}"&&h3&Anrufen&/h3&&/a&
item.phone returns
in index.html:
&meta name="format-detection" content="telephone=yes"&
What's my mistake?
1,26831543
&content src="index.html"/&
&access origin="*"/&
&access origin="mailto:*" launch-external="true" /&
&access origin="tel:*" launch-external="true" /&
Keep these. Remove others.
These two cause net::ERR_UNKNOWN_URL_SCHEME problem:
&allow-navigation href="tel:*" /&
&allow-intent href="tel:*"/&
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Post as a guest
Post as a guest
Post Your Answer
By clicking &Post Your Answer&, you acknowledge that you have read our updated ,
and , and that your continued use of the website is subject to these policies.
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled}

我要回帖

更多关于 openapp 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信