Skype chat screen from intent
Asked Answered
S

2

7

I am trying to make an intent that starts skype conversation with a certain person. Having looked through it all over the stackoverflow, I still cannot make it work properly. Here's my code:

String skypeUri = "skype:name?chat";
Intent intent = new Intent();
intent.setData(Uri.parse(skypeUri));
                intent.setComponent(new ComponentName("com.skype.raider", "com.skype.raider.Main"));
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivity(intent);

My intent filter:

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

It brings me to skype but only to the main page of it, no conversation is opened. Any help would be appreciated.

Schwenk answered 9/10, 2015 at 15:4 Comment(0)
H
3

just use below code

Intent skypeIntent = new Intent("android.intent.action.VIEW");
skypeIntent.setComponent(new ComponentName("com.skype.raider", "com.skype.raider.Main"));
skypeIntent.setData(Uri.parse("skype:" + skypeId + "?chat"));
Hosfmann answered 6/4, 2016 at 8:17 Comment(0)
P
1

Assuming that is your exact code, the problem is that you are not passing the username of the person you want to call. You just have 'name' where their username should be. You need something like:

String skypeUri = "skype:"+username+"?chat";
Puberulent answered 9/10, 2015 at 20:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.