3

I am using below code for opening dial up when clicking on TextView. The problem is it is not working on samsung tablet 10 inch device. It is opening a dialogue box with options 'saving contact' and 'close' rather than opening dial up. I have tested using the same code on Lenovo 7 inch(using api level 19) and Motorolla droid turbo (using api level 22) it is working fine but samsung 10 inch tablet (using api level 21) it is showing dialogue with mentioned options.Am I missing something or this is api specific behavior? Below is the code.

        <TextView
            android:layout_marginLeft="10dp"
            android:textColor="@color/white_color"
            android:layout_marginTop="10dp"
            android:id="@+id/tv_phone"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:autoLink="phone"
            android:textColorLink="@color/white_color"
            android:layout_below="@+id/tv_address"
            android:text="PH: (800) 579-4875 (310) 534-1505" />
5
  • the problem is probably the samsung firmware, it is usually a whole lot different to other android devices and behave in strange ways for common use cases Commented Nov 21, 2016 at 11:54
  • yes, may be. I was thinking the same thing, but was not sure about the bevaior. Commented Nov 21, 2016 at 11:56
  • @AbdulWaheed your samsung tablet 10 inch it's have calling feature? Commented Nov 21, 2016 at 12:03
  • no it does not have calling feature.. Commented Nov 21, 2016 at 12:41
  • AAhhhh I get the point now...thanks to keep my direction there.. Commented Nov 21, 2016 at 12:41

3 Answers 3

2

I am posting the answer. It may be helpful for others. The problem was not in the code or in xml. The problem was with the tablet hardware. My device does not have calling feature that means I don't have sim card slot in my tablet that's why I was not getting dial up screen.

Sign up to request clarification or add additional context in comments.

Comments

0

You can setup click event handler to start dial. It must work for different firmware.

textView.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        Intent intent = new Intent(Intent.ACTION_DIAL);

        intent.setData(Uri.parse("tel:" + "phone number here"));
        startActivity(intent);
    }
});

Comments

0

Try this

TextView phone = (TextView) layout.findViewById(R.id.idPhone);
phone.setAutoLinkMask(Linkify.PHONE_NUMBERS);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.