2013-07-15 45 views
1

我使用一个Intent调用从我的Android应用程序Skype联系人,这里是代码:Skype的4机器人,叫意图

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,在联系S上)。现在它只让我进入“近期行动”标签。有没有人有同样的问题?这个问题是否来自我的代码?

回答

3

那么,经过一些研究并查看了skype uri的语法(http://dev.skype.com/skype-uri)之后,我意识到链接的一部分在我的代码中缺失。

因此,要发送的数据现在是:

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

我知道你可能已经找到了答案,但如果没有(和其他开发者),你可以做这样的:

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> 
0

如果你想调用聊天,而不是调用然后加入:

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