I have a NestedScrollView with a WebView inside. The WebView contains an HTML file with anchors, that are linked to the same file but difference places (imagine "menu" and "content" containers. when you click on a menu item the corresponding section in "content" should appear on the screen).
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:id="@+id/svNested"
android:layout_height="match_parent"
tools:showIn="@layout/activity_single"
android:background="@color/colorPrimary">
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.v4.widget.NestedScrollView>
Loading data:
webView?.loadDataWithBaseURL(null, htmlContent, "text/html", "UTF-8", null)
The problem is that these anchors doesn't work as expected.