2013-07-15 84 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"));