3

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.

  • How do I know which Google Talk intents are available to call?
  • How do I know which intents are available to call in general?

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?

Adam Baxter
  • 1,907
  • 21
  • 41
Ijaz Ahmed
  • 2,330
  • 4
  • 19
  • 27

1 Answers1

7

First question:

Uri imUri = new Uri.Builder().scheme("imto").authority("gtalk").appendPath("username(e.g.user@googlemail.com)").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);
Franziskus Karsunke
  • 4,948
  • 3
  • 40
  • 54
  • Franziskus Karsunke, thank you so much for you answer, i hope it will be helpful alot, let me try then i will come back to you :)..Thanks alot – Ijaz Ahmed May 26 '11 at 08:19