0
I can do Hyperlink perfectly, the problem is that your color is not contrasting well with the background of my application (follows picture):
I would like to know how to change your color, since changing the text color of the textView does not work, because the hyperlink always turns pink.
Code of the Activity:
package genesysgeneration.font4;
import android.graphics.Typeface;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.widget.CheckBox;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private TextView tvLink;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tvLink=(TextView)findViewById(R.id.tvLink);
tvLink.setText(Html.fromHtml("<a href=\"http://www.google.com\">google</a>"));
tvLink.setMovementMethod(LinkMovementMethod.getInstance());
}
}
xml by Activity:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@drawable/back"
tools:context="genesysgeneration.font4.MainActivity">
<TextView
android:id="@+id/tvLink"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="133dp"
android:text="google"
android:textColor="#FFFFFF"
android:textSize="24sp" />
</RelativeLayout>