简体   繁体   English

Uri.Parse已弃用

[英]Uri.Parse deprecated

I have a barcode scanner app. 我有条形码扫描仪应用程序。 I am trying to scan barcode and search at google. 我正在尝试扫描条形码并在谷歌搜索。 But when I try to search as mentioned here , It says Uri.Parse() deprecated . 但是当我尝试按照这里提到的搜索时,它说Uri.Parse() 已弃用 I couldn't find anything useful and Uri documentation does not say anything about it. 我找不到任何有用的东西, Uri文档没有说明任何内容。

Uri Documentation Uri文档

https://developer.android.com/reference/android/net/Uri.html https://developer.android.com/reference/android/net/Uri.html

Is there any other option or replacement it? 有没有其他选择或更换它?

You are referencing the Uri from System in which Parse is Obsolete : 您正在引用System中的Uri ,其中ParseObsolete

[ObsoleteAttribute("The method has been deprecated. It is not used by the system.
protected virtual void Parse()

The SO question you are referencing is using Uri from the Android.Net namespace: 您引用的SO问题是使用Android.Net命名空间中的Uri

Android.Net.Uri uri = Android.Net.Uri.Parse("http://www.google.com/#q=fish");
var intent = new Intent(Intent.ActionView, uri);
StartActivity(intent);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM