Link the TextView without using webview

Java
TextView link;
link = (TextView) findViewById(R.id.link);
link.setMovementMethod(LinkMovementMethod.getInstance());

Strings.xml

<string name="link_google"><u><a href="http://google.co.in">Go to Google</a></u></string>

mainActivity.xml

<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#80BFFF"
        android:text="@string/link_google"
        android:id="@+id/link"
        android:layout_gravity="center_vertical"
        />


Comments

Popular posts from this blog

Flutter Bloc - Clean Architecture

What's new in android 14?

Dependencies vs Dev Dependencies in Flutter