4

I need to open the dial action when I click on TextView, but this does not happen. With a long number in the international format, everything is OK. Tell me how to solve the problem?

TextView phoneNumber = (TextView) findViewById(R.id.companyPhoneNumber);
phoneNumber.setText("7040");
phoneNumber.setMovementMethod(LinkMovementMethod.getInstance());

XML:

 <TextView
 android:id="@+id/companyPhoneNumber"
 style="@style/tvs_company_info_text_blue"
 android:autoLink="phone"
 android:text="@string/txt_companyinfo_phone_number"/>

P.S. How to solve the problem using Intent.ACTION_DIAL or Intent.ACTION_CALL I know. I'm interested in how to solve it through Linkify.

EfremovAV
  • 91
  • 10
  • 1
    Possible duplicate of [How do I get the dialer to open with phone number displayed?](https://stackoverflow.com/questions/11699819/how-do-i-get-the-dialer-to-open-with-phone-number-displayed) – PPartisan Dec 22 '17 at 09:16

1 Answers1

3

Try this

Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + your_number);
startActivity(callIntent);
AskNilesh
  • 67,701
  • 16
  • 123
  • 163
kamal verma
  • 496
  • 3
  • 16