Question

I am using an Intent to call a skype contact from my android application, here is the code:

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);

The thing is this code is not working since the last update of skype (to the version 4.0.0.19550, on a nexus S). Now it only drives me to the "recent actions" tab. Does anyone have the same problem? Does this problem come from my code ?

Était-ce utile?

La solution

Well, After a few researches and a look at the syntax of the skype uri ( http://dev.skype.com/skype-uri ), I realized a part of the link was missing in my code.

So the data to send is now:

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

Autres conseils

If you want to invoke chat instead of call:

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

I know you may have already found the answer, but if not (and for other developers), you can do it like this:

   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);

Then add in AndroidManifest.xml

    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:scheme="skype" />
    </intent-filter>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top