How to make links in a TextView clickable?

后端 未结 30 3306

I have the following TextView defined:



        
30条回答
  •  心在旅途
    2020-11-21 23:56

    Use this...

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

    and add permission in manifest file

    
    

提交回复
热议问题