In Android Studio I get this warning shouldOverrideUrlLoading is Deprecated
if I add this line @SuppressWarnings("deprecation")
I dont get anymore the warning but is it correct to do that? This is the code I use
public class MyAppWebViewClient extends WebViewClient {
@SuppressWarnings("deprecation")
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if(Uri.parse(url).getHost().length() == 0) {
return false;
}
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
view.getContext().startActivity(intent);
return true;
}
}