Monthly Archives: June 2018

Clickable link in textview

Create resource in strings.xml. <string name=”txtCredits”>Support: <a href=”http://www.stackoverflow.com”>click here</a></string> 2. Create textview in layout and assign string. <TextView android:id=”@+id/textLink1″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”@string/txtCredits” /> 3. Modify in activity. link1 = (TextView) findViewById(R.id.textLink1); link1.setMovementMethod(LinkMovementMethod.getInstance());  

Posted in Android | Leave a comment