无活动处理的意图action.dial [英] No activity found to handle intent action.dial

查看:217
本文介绍了无活动处理的意图action.dial的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让我的应用程序从一个EditText拨打一个号码,但我得到:

  android.content.ActivityNotFoundException:无活动来处理意图行事{= android.intent.action.DIAL DAT =环形电话NR。 123456789}

我搜索了一会儿回答,但大多数answes是权限和增加活动的清单。我已经做了两个,如果我不这样做是错误的。而且我我的手机,而不是模拟器上运行它。我试过既没有意图过滤器。下面是codeS:
清单:<使用许可权的android:maxSdkVersion =19机器人:名字=android.permission.CALL_PHONE/>

 <活动
        机器人:名字=nu.sluggo.testapp.annons.Activity2>
        &所述;意图滤光器>
    <作用机器人:名字=android.intent.action.DIAL/>
    <类机器人:名字=android.intent.category.DEFAULT/>
&所述; /意图滤光器>


键拨打电话(从共享preFS得到电话号码下方至A1 :)

  knapp_ring.setOnClickListener(新View.OnClickListener(){
        意图通话=新意图(Intent.ACTION_DIAL);
        @覆盖
        公共无效的onClick(视图v){
            call.setData(Uri.parse(Telnr:+ A1));
            startActivity(电话);
        }
    });


解决方案

环电话NR。 123456789 不是一个有效的电话号码,这就是在你的意图Telnr:+ A1 也将不会出现有效。使用电话:后面的电话号码传递给值Uri.parse()

  Uri.parse(电话:+ A1)

I'm trying to make my app call a number from an EditText, but I get:

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.DIAL dat=Ring Tel nr. 123456789 }

I've searched a while for an answer, but most of the answes are permissions and add activity to the Manifest. I've done both, if I'm not doing it wrong. And I'm running it on my phone, not the emulator. I've tried both with and without the intent-filters. Here are the codes: Manifest: <uses-permission android:maxSdkVersion="19" android:name="android.permission.CALL_PHONE"/>

        <activity
        android:name="nu.sluggo.testapp.annons.Activity2">
        <intent-filter>
    <action android:name="android.intent.action.DIAL" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

Button to make the call (gets phone number from SharedPrefs to a1 below:)

        knapp_ring.setOnClickListener(new View.OnClickListener() {
        Intent call = new Intent(Intent.ACTION_DIAL);
        @Override
        public void onClick(View v){
            call.setData(Uri.parse("Telnr:" + a1));
            startActivity(call);
        }
    });

解决方案

Ring Tel nr. 123456789 is not a valid phone number, and that is what is in your Intent. "Telnr:" + a1 also would not appear to be valid. Use tel: followed by the phone number as the value passed to Uri.parse():

 Uri.parse("tel:" + a1)

这篇关于无活动处理的意图action.dial的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆