读书人

关于Intent.ACTION_DIAL无法启动的有关

发布时间: 2013-12-15 22:17:18 作者: rapoo

关于Intent.ACTION_DIAL无法启动的问题!求大神指教。
java文档如下:
@Override
public void onClick(View v) {//重写onClick方法
Intent myIntent = new Intent(Intent.ACTION_DIAL);//创建Intent对象
Sample_3_5.this.startActivity(myIntent);//启动Android内置的拨号程序
}

XML如下:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="wyf.wpf"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Sample_3_5"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_BUTTON" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

</application>
<uses-sdk android:minSdkVersion="7" />

</manifest>

出现的错误是android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.DIAL }

看的是ANDROID 2.0游戏开发实战宝典,网上查了很多方法代码应该没错,为什么一直有这个错误?是AVM没有拔号这个功能么?
关于Intent.ACTION_DIAL无法启动的有关问题!求大神指教
我的虚拟机是这样的,求大神指教!


[解决办法]
换个版本的虚拟机
[解决办法]
需要权限,加入对应的权限
[解决办法]
理论上没问题的,你要不用这个试试:
Intent myIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:123"));

再不行,你用真机测试测试,看手机上行不行。
[解决办法]
force close 看看log ,
试试楼上的这个,应该可以的,我当时就是这个搞得,本来是在布局中有个属性,但是那个属性有时候有问题,最后修改为这个样子
Intent myIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:123"));

读书人网 >Android

热点推荐