【问题标题】:Perhaps you didn't include a PendingIntent in the extras?也许您没有在附加内容中包含 PendingIntent ?
【发布时间】:2016-08-19 14:39:37
【问题描述】:

我不明白为什么我的应用在安装 apk 时崩溃了? 我想点击动作按钮,然后打电话 日志猫:

08-19 17:26:06.466 15592-15954/? E/MPlugin: Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport
08-19 17:26:06.332 15592-15592/? E/NetworkScheduler.SR: Invalid parameter app
08-19 17:26:06.332 15592-15592/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?

main_activity.java

   public void Call(View v)
    {
        Intent intentcall= new Intent(Intent.ACTION_DIAL);
        intentcall.setData(Uri.parse("tel:103"));
        startActivity(intentcall);

    }

xml:

  <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end|bottom"
        android:layout_margin="@dimen/fab_margin"
        android:src="@android:drawable/ic_dialog_email"
        android:onClick="Call"/>

【问题讨论】:

    标签: java android android-intent android-pendingintent


    【解决方案1】:

    我测试了你的方法,效果很好。语法正确,fab 没有错误。由于“快速运行”功能 (see...),您的应用在安装 apk 时崩溃的事实看起来像是 Android Studio 的故障。

    通过关闭应用程序(如果它已经在运行)和/或单击红色停止按钮,尝试在停止应用程序后进行安装。

    here

    【讨论】:

    • 这是一个解决方案吗?
    • 也许有一天它会成为解决方案:J
    猜你喜欢
    • 2015-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-16
    • 2016-03-27
    相关资源
    最近更新 更多