Ijaz Ahmed
Ijaz Ahmed

Reputation: 2370

Android - Google Talk Intents

I am developing an Android application which Google Talk contacts are displayed with their status - this is working fine.

I am not sure which intent should be called to open a chat window using the default Talk app.

I am unable to get the following code to work:

Uri imUri = new
Uri.Builder().scheme("imto").authority("skype)").appendPath("apactple").build();             
Intent intent = new Intent(Intent.ACTION_SENDTO, imUri); 
this.startActivity(intent);

Any ideas?

Upvotes: 3

Views: 3030

Answers (1)

Franziskus Karsunke
Franziskus Karsunke

Reputation: 5208

First question:

Uri imUri = new Uri.Builder().scheme("imto").authority("gtalk").appendPath("username([email protected])").build();
Intent intent = new Intent(Intent.ACTION_SENDTO, imUri);

Second question:

final PackageManager packageManager = context.getPackageManager();
final Intent intent = new Intent(Intent.ACTION_SENDTO);
List<ResolveInfo> resolveInfo =
        packageManager.queryIntentActivities(intent,
                PackageManager.MATCH_DEFAULT_ONLY);

Upvotes: 7

Related Questions