【问题标题】:skype 4 android, call intentSkype 4 android,呼叫意图
【发布时间】:2013-07-15 14:33:44
【问题描述】:

我正在使用 Intent 从我的 android 应用程序中调用 Skype 联系人,代码如下:

Intent skypeIntent = new Intent(Intent.ACTION_VIEW);
skypeIntent.setData(Uri.parse("skype:" + contactUserName));
skypeIntent.setComponent(new ComponentName("com.skype.raider", "com.skype.raider.Main"));
skypeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(skypeIntent);

问题是自从上次更新 Skype(到版本 4.0.0.19550,在 nexus S 上)以来,此代码无法正常工作。现在它只会将我带到“最近的操作”选项卡。有没有人有同样的问题?这个问题是否来自我的代码?

【问题讨论】:

    标签: android skype


    【解决方案1】:

    好吧,经过一些研究并查看了 Skype uri (http://dev.skype.com/skype-uri) 的语法,我意识到我的代码中缺少部分链接。

    所以现在要发送的数据是:

    skypeIntent.setData(Uri.parse("skype:" + contactUserName + "?call"));
    

    【讨论】:

      【解决方案2】:

      如果你想调用聊天而不是调用:

      skypeIntent.setData(Uri.parse("skype:" + contactName + "?chat"));
      

      【讨论】:

        【解决方案3】:

        我知道您可能已经找到了答案,但如果没有(对于其他开发人员),您可以这样做:

           Intent skypeIntent = new Intent(Intent.ACTION_VIEW);
                      skypeIntent.setData(Uri.parse("skype:" + contactUserName+ "?call&video=true"));
        //make call only then use  bellow given code
         //skypeIntent.setData(Uri.parse("skype:" + contactUserName+ "?call"));
                      skypeIntent.setComponent(new nentName("com.skype.raider", "com.skype.raider.Main"));
                      skypeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                      MainActivity.this.startActivity(skypeIntent);
        

        然后添加AndroidManifest.xml

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="skype" />
            </intent-filter>
        

        【讨论】:

          猜你喜欢
          • 2023-03-24
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-10-18
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多