How to get favicon of any website by entering its URL in android. Or there is any program when we enter the URL the program automatically FATCH its icon and we can use these icon further in android studio in java.
Asked
Active
Viewed 1,018 times
1 Answers
1
This is how you can receive the icon of url in android.
WebView webView = new WebView(getActivity());
webView.loadUrl("https://" + url);
webView.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
progressBar.setProgress(newProgress);
}
@Override
public void onReceivedIcon(WebView view, Bitmap icon) {
super.onReceivedIcon(view, icon);
faviconIV.setImageBitmap(icon);
}
});

Fahad Bin Asif
- 66
- 7
-
This is correct answer because every website has different path for its favcion. – soggypants Jan 26 '23 at 21:02