How to enable deep-linking in WebView on Android app?

The answer of @pranav is perfect but might cause crash if there are no apps to handle the intent. @georgianbenetatos's solution to prevent that helps

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
if (intent.resolveActivity(getPackageManager()) != null) {
   startActivity(intent);
} else {
   Toast.makeText(this, R.string.no_apps_to_handle_intent, Toast.LENGTH_SHORT).show();
} 

This is the problem with android web view as this treats everything as URL but other browser like chrome on mobile intercepts the scheme and OS will do the rest to open the corresponding app. To implement this you need to modify your web view shouldOverrideUrlLoading functions as follows:

 @Override
 public boolean shouldOverrideUrlLoading(WebView view, String url) {
        LogUtils.info(TAG, "shouldOverrideUrlLoading: " + url);
        Intent intent;

        if (url.contains(AppConstants.DEEP_LINK_PREFIX)) {
            intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse(url));
            startActivity(intent);

            return true;
        } 
 }

In above code replace AppConstants.DEEP_LINK_PREFIX with your url scheme eg.

android-app://your package

Hope this helps!!