TextView android:autoLink= "phone"调用 android.intent.action.VIEW 导致 ActivityNotFoundException



我想显示电话号码,单击它应该可以呼叫。

在我的布局中:

 <TextView
        android:id="@+id/text_phone"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:autoLink="phone" />

我已添加权限:

<uses-permission android:name="android.permission.CALL_PHONE"/>

但是在单击电话链接时,它会给出例外

02-15 03:24:45.533: E/MessageQueue-JNI(8446): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=tel:xxxxxxxxxx (has extras) }

不知道为什么它会发送意图ACTION_VIEW而是应该发送ACTION_CALL。

我的安卓版本是4.2.2

如果我错过了什么,请告诉我。

尝试使用带有SIM卡的真实设备进行测试..!可以执行调用任务。

这样做

mobileTextView.setText(Html.fromHtml(" +98999999999") );

并检查您的清单是否添加了此类

还添加

 android:autoLink="phone"

相关内容

最新更新