Dialing a phone call on click of textview in android

后端 未结 6 911
醉话见心
醉话见心 2020-12-03 01:05

I have a question that I want to dial a phone call when I click on a text view which also contain a phone number. But when I click on a Text view it returns an error as:

6条回答
  •  不知归路
    2020-12-03 01:45

          TextVIew dialers=(TextView)this.findViewById(R.id.dialer);
          dialers.setOnClickListener(new View.OnClickListener()
        {
            public void onClick(View view) 
            {
                            launchDialer(dialers.getText().toString());
                        }
    
           });
    

提交回复
热议问题