Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. I couldn't find anything useful and Uri documentation does not say anything about it.

Uri Documentation

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

Is there any other option or replacement it?

like image 398
Pareidolia Avatar asked Sep 05 '16 08:09

Pareidolia


1 Answers

You are referencing the Uri from System in which Parse is Obsolete:

[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:

Android.Net.Uri uri = Android.Net.Uri.Parse("http://www.google.com/#q=fish");
var intent = new Intent(Intent.ActionView, uri);
StartActivity(intent);
like image 102
SushiHangover Avatar answered Sep 28 '22 08:09

SushiHangover