Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/213.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何将文本视图的文本链接到网站_Android_Textview - Fatal编程技术网

Android 如何将文本视图的文本链接到网站

Android 如何将文本视图的文本链接到网站,android,textview,Android,Textview,我知道这是一个非常简单的问题。但是我用很多方法阅读了很多教程。你能告诉我在文本视图中动态链接文本到网站的最简单方法吗?意思是我不想在文本中包含链接名,这会像网页中的href标签一样显示。希望你;;得到我的问题 <TextView android:id="@+id/textView6" android:layout_width="wrap_content" android:layout_height="wrap_content"

我知道这是一个非常简单的问题。但是我用很多方法阅读了很多教程。你能告诉我在文本视图中动态链接文本到网站的最简单方法吗?意思是我不想在文本中包含链接名,这会像网页中的href标签一样显示。希望你;;得到我的问题

<TextView
        android:id="@+id/textView6"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView1"
        android:layout_centerHorizontal="true"
        android:text="PoliticiansNpolitics.in"
        android:textColor="#4169E1"
        android:textAppearance="?android:attr/textAppearanceLarge" />


我想在点击后将上面的文本重定向到google.com。您可以按如下所示为click listener提供文本视图

 tv.setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    Intent browserIntent = new Intent(Intent.ACTION_VIEW,
                            Uri.parse("http://www.google.com"));
                    startActivity(browserIntent);
                }
            });

其中
tv
是您的文本视图id

我不想在文本中添加链接名。我不想在文本中显示链接名称..点击文本后,它应该直接显示it@user3336646检查编辑的答案